Hi all, i ve got a javascript code. but i want to use a php function instead of this javascript code. You know, some people block javascripts, due to this reason i would like to use server side coding. However, i could not write a php function yet. Any help would be great for me. here is my java script code: <html> <body> <table> <tr> <td> <img id="bigImage" src="images/spacer.gif"> <--! my other contents. !--> </td> </tr> </table> <script type="text/javascript"> function LoadImage() { if (document.getElementById("bigImage")) { document.getElementById("bigImage").src="images/big.gif"; } } LoadImage(); </script> </body> </html> ------------------------ Acutually, im using this javascript code in php file. i wrote codes in html to show you basicly. Thank you to all friends With best regards
Short answer: you probably can't. Medium answer: if you can, it probably won't work like you wan't it to. Long Answer: What triggers LoadImage() to execute? If its something that doesn't require the user to click something, it probably won't work at all. Even if it does require the user to click something, when you use php and php alone, it will require the entire page to reload to accomplish it.
I was wondering as well... what is triggering LoadImage()? because scrolling further down you have LoadImage(); and it seems like its executed already why not just load big.gif right from the start?