Hi guys, Can you please help me, I want to find out how I can check on if statement using with html or javascript to see if the image on the webpage does exist then replace the image. Does anyone know how i can do this? thanks in advance
that is making no sense, i want to know how I can create a filename for the image on the webpage and I also want to out how I can check on the if statement to see if the image on the webpage is exist. Like this: $image1 = <div id="image1" style="position:absolute; overflow:hidden; left:415px; top:157px; width:114px; height:81px; z-index:0"><img src="/images/tvguide_blue.jpg" alt="" title="" border=0 width=114 height=81></div> Code (markup): On my webpage, it display as "$image =". Do you know how i can create a function for a filename so I can write something like this: if ($image = exist) { // do something } Code (markup): Do you have any idea? thanks in advance
I usually use PHP to do this..You need to explicitly manipulate the code that you are altering.. function manipulate_image($the_output) { $breakdown = '/<a(.*?)href="(.*?).(bmp|gif|jpeg|jpg|png)"(.*?)>/i'; $manipulate = image_ID(); /* In this case, I'm injecting an ID into my statement from a function defined elsewhere */ $newstatement = '<a$1href="$2.$3" id=\'.$gettheID.\'$4>'; $the_output = preg_replace ($breakdown,$manipulate,$the_output); return $the_output; } This will inject an ID into my images. You just wanted the query images string, this one has it. Additionally, this teaches you how to manipulate the statement. Hope it helped
Do you want to see whether the image file exists on the server, or whether the image is showing in the user's browser? (If in the browser, there's no filename associated with the "image" - the image file is sent to the user's browser, and it's up to the browser to show it. Assume that it's showing. You can't check to find out if it is.)
HTML is not a programming language (wow, me saying that!) in that it doesn't HAVE "if" statements, it doesn't HAVE variables... The dollar sign on a variable makes it LOOK like you are using PHP hence others reaction, but the lack of quotes makes no sense whatsoever. In general all your posts are gibberish -- I don't think you are fully grasping the technologies you are trying to use as your terminology is all wrong, which is why all the responses are incomprehensible as well. I can't even figure out what you are asking -- as Rukbat was saying are you asking for if it exists on the server (PHP or some other server-side language), or that it's loaded client side? (Javascript's onload method)... as to 'replacing' it, that shouldn't be done client side (HTML) at all... You're question just doesn't make any sense.