Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. also, you can't just echo $image. It's an image source object. If you want to output it to browser, you have to do it like this: header('Content-type: ' .image_type_to_mime_type($type)); imagejpeg($tn); // for jpg files, there's other image type equivalents to this
  2. Yes, that is raw image data. And you are getting that error because you are outputting something before it. See the sticky about headers.
  3. makethumb($Url,260); This send image header and output the image directly. You don't really want to do this unless the only thing being output from your script is the image. $image = makethumb($Url,260,false); This will make the change to the image and return the altered image resource. You will want to do it like this if you are wanting to do something more with the image and then output it later, or save it to disk instead or whatever.
  4. how are you actually using it on your site? Sounds like you are calling the function and then echoing out what it returns (leaving that last argument true). If that's what you are doing, you need to send the proper headers first so that the browser knows its an image to be rendered. Otherwise, the browser is just printing out the raw data of the image. Look at the function, at the code when $rt is set to false.
  5. javascript is processed client-side so not an *easy* way to do it. But it IS possible see example . However with google maps specifically, depending on what exactly your needs are, you can use server-side scripting to build a url with query string to output as an img and google will process it and return a map based on parameters you sent in img src. It is of course a static image, so that may or may not work for you, but if it does, there you have it. http://code.google.com/apis/maps/documentation/staticmaps/
  6. Do badgers lactate?
  7. procedural programming vs. oop programming is a way of programming, following certain philosophies and patterns. You can for instance use objects in php but still program in a procedural way (which is what a lot of people actually end up doing, because they fail to understand what it really means to program oop style). The point I'm trying to make is that if you need to go learn some desktop application language like c++ or java or vb or delphi or whatever...you're going to have to go through the motions of learning the syntax regardless, and if you're set in stone about doing it procedural style, then just...do it procedural style. On that note, since you seem to know php, I would suggest you go for c++ since that's what php is written in. You (should) be able to pick up on the syntax rules a lot faster.
  8. http://www.jquery.com click the big download button, upload it to your server, throw a script tag on your page pointing to it. Looks like you also need to download and put a script include for the UI/dialog plugin as well (you can also find it on their site).
  9. LOL wow... look in the mirror mate. We see people like you all day long, and it's always the same story. You went and learned some basics about something, or maybe you're an expert at doing your own unrelated job, whatever it is. Then you took on a client/project not knowing even where to begin even from a top level because you were either a) Too greedy for the money b) Didn't have the balls to say no c) Foolishly thought "How hard can this stuff be?" d) One or more of the above Then the reality sets in and now you're sweating bullets, and the only plan of action you've come up with is to go ask for help on a public forum. And if you really thought our opinions are irrelevant, then why are you here? Seriously, you can stomp your foot and get pissy all you want but advising you to hire someone with experience or otherwise pass it off really is the best advice we can give you.
  10. anyways...is there a reason you can't just do this? var y = document.getElementById('myitem').offsetTop;
  11. noscript tags are used to execute html when javascript is disabled or otherwise not available. You cannot do the same thing with pure html as you can with javascript...otherwise there would be no point in using javascript. What you need to ask yourself is: "If the user has javascript disabled, what static html content do I want my user to see instead?"
  12. In your conditions you are using $_POST[...] instead of $totalwords and $amountneeded p.s. - this is not a regex question.
  13. Are you talking about defining a css class in general, like <style='text/css'> .someClass { border: 1px; } </style> It would help if you explain what exactly it is you're trying to accomplish specifically.
  14. You cannot do this with javascript. You have to use server-side script to get a list of files in directory on server and output it to the client (in the form of a js array or whatever). You can do it on page load or use ajax to make a request to server-side script to get a listing and return results.
  15. HTMLElement.prototype.getY = function(){ return this.offsetTop; } var y = document.getElementById('myitem').getY();
  16. okay well it worked just fine for me .... for reference, this is what I am working with: <form action="search.php" method="get"> <div class="search"> <div class="searchArrowHover"> <div class="arrUp"></div> <dl> <dt></dt> <dd name="search_category"><a href="/">All</a></dd> <dd name="search_category"><a href="/">People</a></dd> <dd name="search_category"><a href="/">Companies</a></dd> <dd name="search_category" class="last"><a href="/">Inbox</a></dd> </dl> </div> <input type="text" size="25" name="search" id="searchInputBox" value="Search" /> <input type="image" name="submit" src="/assets/img/search.png" /> </div> </form> <script type='text/javascript'> var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onclick = function(){ for (var c=0; c<drop_selected.length; c++) { drop_selected[c].setAttribute("class", ""); } this.setAttribute("class", "drop_selected"); return false; } } </script> When I click on a link, page is not refreshed, and I see class for previous one being removed from previous and class being added on the one that was clicked.
  17. removing the first one *should* do it. But anyways, seeing as how you aren't wanting the page to refresh, why are you wrapping them in anchor tags to begin with? My first suggestion for you would be to remove the anchor tags. If you're looking to make them look like links in general, then style the dd tags to make it look like it (add underline, :hover attrib, etc...)
  18. There is probably a more elegant way to do this (maybe along the lines of keeping track of the last clicked object and removing the class, instead of looping through all of them like I did), but this works: var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onclick = function(){ for (var c=0; c<drop_selected.length; c++) { drop_selected[c].setAttribute("class", ""); } this.setAttribute("class", "drop_selected"); } } And yes, you would just hardcode the first one with class="drop_selected" for the default
  19. If I show you how to do that, are you just gonna come back again and say "Oh but what, there's yet another thing I didn't bother to mention before?"
  20. okay well "click on" is not the same as "on change". I kinda had my doubts about it, seeing as how that's not a select tag, but I assumed you knew what you were doing with that .onchange. You will want to change .onchange to .onclick
  21. first off, in your getElementsByName(..) you typoed your name...but anyways, getElementsByName() returns an array of all elements that match the specified name. So you need to loop through it, something like this: var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onchange = function(){ this.setAttribute("class", "drop_selected"); } }
  22. looks like everything is mostly consistently named, so you can reduce it to this: function swapImages(that) { that.src = (that.src.indexOf('buttonselected')>-1) ? ("images/"+that.id+"button.gif") : ("images/"+that.id+"buttonselected.gif"); } <img src="images/homebutton.gif" class="buttons" id="home" onmouseover="swapImages(this)" onmouseout="swapImages(this)" /> <img src="images/packagebutton.gif" class="buttons" id="packages" onmouseover="swapImages(this)" onmouseout="swapImages(this)" /> <img src="images/purchasebutton.gif" class="buttons" id="purchase" onmouseover="swapImages(this)" onmouseout="swapImages(this)" /> only thing is that you need to make your id="..." match your image prefix. Some of them don't match. Like id="package" vs. "packagesbuttonselected.gif". Need to either change your id to "packages" or rename your .gif to "packagebuttonselected.gif"
  23. Okay well then...
  24. Maybe your schools are using IE5 or something. Schools have a tendency to use outdated stuff. As mentioned previously, jQuery works for IE6+. And as far as IE9...IE9 just went from preview to beta. You cannot expect things to work 100% in a beta. But nonetheless, so far I did some quick research and I am not seeing any reports of problems with .click() and IE9. But if you really think there is some kind of bug with IE9 then I suggest you report it on jquery.com
  25. p.s. - not a fact that click() doesn't work at all in certain versions of IE. With very few exceptions, the core jquery.js library MUST work for all major browsers and versions, otherwise it wouldn't be put into it. I am quite sure it is some problem on your end, be it something in my previous post or else a problem in some other part of your code that you aren't showing. I mean even here you keep saying inconsistent things. You say that you tested with ONLY that code but then turn around and say that you are testing it somewhere that has lots of other code. You JUST said in your previous post that it did not work in IE8..but then you are now saying it does! And now you are claiming it doesn't work in older versions but then can't say which ones. The bottom line is that if a core jquery method being used in an extremely basic example did not work in these major browser versions as you claim, it would be a well known issue. The reason it's not working is not because .click() doesn't work, it's because you are either not using it correctly or else you had some browser setting turned off or disabled or not pointing to the right file, etc... I'm sorry, but that's just how it is. I'm not trying to fight here...I'm here to help, not fight. But you aren't going to solve your problem unless you stop making assumptions and be more accurate in your posts.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.