All day I struggled with this, and I got to the point where my code wasn’t working at all! I am trying to do this:
When the user clicks ImageButton1 , this image is replaced by another Image of LoadingImg , and then after 10 seconds this image is replaced by another image / ImageButton2 button
Here is my non-functional code:
<img src="images/xboxsite_14.gif" id="ImageButton1" onClick="showLoad()"> <img src="images/getld.png" id="ImageButton2" alt="Get Last Digits" style="display:none;"> <img src="images/Loader.gif" id="LoadingImg" style="display:none;"> <script type="text/javascript" language="javascript"> function showLoad() { document.getElementById('ImageButton1').src=document.getElementById('LoadingImg').src; document.getElementById('LoadingImg').style.display='block'; setTimeout(swapImageSrc, 1000); } function swapImageSrc() { document.getElementById('LoadingImg').src = document.getElementById('ImageButton2').src; document.getElementById('LoadingImg').style.display='none'; document.getElementById('ImageButton2').style.display='block'; document.getElementById('Code1String').style.display='block'; } </script>
The only thing I can think of is that I changed the charset from 'charset = iso-8859-1' to 'charset = UTF-8', because I accidentally got the error 'unsupported characters' (they are not there).
If anyone can fix this, I will be very grateful, thanks!
Harry source share