Swapping image + server side script [modified]
-
Hi All, Can any one help me for the following please. I have an image on Main page this image is a link to the popup page. Wehn you click on the image it shows you a popup page where you can do some actions, I am asking user to insert some information into the database on this popup. Whenuser insertes a record I need to change the image on main page i.e if Image souurce was image1.jpg I want to change it to image2.jpg. Any ajax , c# or Javascript code will do to me. Thanks in advance
Naveed Kamboh Complexity kills, Write easy code for your self. Punjabi stuff
modified on Wednesday, December 17, 2008 11:20 AM
-
Hi All, Can any one help me for the following please. I have an image on Main page this image is a link to the popup page. Wehn you click on the image it shows you a popup page where you can do some actions, I am asking user to insert some information into the database on this popup. Whenuser insertes a record I need to change the image on main page i.e if Image souurce was image1.jpg I want to change it to image2.jpg. Any ajax , c# or Javascript code will do to me. Thanks in advance
Naveed Kamboh Complexity kills, Write easy code for your self. Punjabi stuff
modified on Wednesday, December 17, 2008 11:20 AM
If you have an id assigned to your tag, such as
You could execute certain code on a onclick or onblur event: The javascript code itself would be: changeImage() { var i = new Image(); i.src = "/images/image2.jpg"; document.getElementById("foobar").src = i.src; } Hope this helps, m1ke places.ae