473,785 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing image source stops working

I'm using a simple, pseudo progress bar. Very simply, I display a still
image next to a form submit button until the user clicks on it, and then
I change the image source to an animated version of the still image.

Like so (I use php a lot) ...

-- the submit button and still image --
<input type=submit name="update _stats" value="Update Mailbox Stats"
class="button">
<img id="loading" src="still_imag e.gif">

-- the onSubmit JavaScript --
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>"
onSubmit="docum ent.getElementB yId('loading'). src='animated_i mage.gif';
return true;">

This works great. When I click the submit, the animated gif appears (a
common little spinner) until the page reloads with the still image.
However, after using it a few times (leaving the window open), the
animated gif stops appearing when I click on the submit button.

By playing around I have discovered that if I change the JavaScript,
save the page and reload, it works again (just arbitrarily - I change
"return true" to "return false" - save the page - reload it - change it
back to "return true" - save it - reload it and then it works as
intended again ... a few times ... until it breaks again).

I've tried deleting the cache and using a shift (forced) reload of the
page, but that doesn't help. I'm using Firefox 1.5. Am I doing
something wrong, ... is Firefox doing something wrong, ... or is this
method faulty?

--
*************** **************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*************** **************
Oct 30 '06 #1
1 3416
Chuck Anderson wrote:
I'm using a simple, pseudo progress bar. Very simply, I display a still
image next to a form submit button until the user clicks on it, and then
I change the image source to an animated version of the still image.

Like so (I use php a lot) ...

-- the submit button and still image --
<input type=submit name="update _stats" value="Update Mailbox Stats"
class="button">
<img id="loading" src="still_imag e.gif">

-- the onSubmit JavaScript --
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>"
onSubmit="docum ent.getElementB yId('loading'). src='animated_i mage.gif';
return true;">

This works great. When I click the submit, the animated gif appears (a
common little spinner) until the page reloads with the still image.
However, after using it a few times (leaving the window open), the
animated gif stops appearing when I click on the submit button.
Soooo, .... I seem to have figured this out myself (so far so good,
anyway). I needed to preload the second image - the animated gif. It
seems to be working all the time now.

--
*************** **************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*************** **************
Oct 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6594
by: Frostillicus | last post by:
Hi, I've written some javascript to randomly choose a classical music composer's picture and sample audio and display it on my home page (http://marc.fearby.com/), and this works fine in Mozilla but has problems in IE. Here's the code: imagestring = "<img src=\"" + imagedir + composers + "\" />"; objimage.innerHTML = imagestring;
24
3531
by: Charles Crume | last post by:
Hello; My "index.htm" page has 3 frames (content, navigation bar, and logo). I set the "SRC" of the "logo" frame to a blank gif image and then want to change it's contents after the other two frames have been loaded by using a javascript statement from the "navigation" frame, as shown below: top.window.ccs_logo.src = 'images/ccs_logo.gif'; alert(top.window.ccs_logo.src);
15
31810
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and help. Regards
1
2510
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks- John
0
1270
by: johkar | last post by:
If you add a background image to a link, the spinning Microsoft logo stops spinning in IE 6 after you click the link and move the mouse off it. Most people never notice this, but in applications where there is a slight delay before going to the next page, the logo stops spinning and the progress bar stops working if you mouse off the link. I am using the "sliding doors" technique to add rounded corners to tabs. I have been unable to...
1
4092
by: miguelfc | last post by:
Hi, I've searched a lot and couldn't find an answer to my problem. I want to have a field in my form that allow me to paste an image from the clipboard to, for example, a Paint field. Then, I want to save that image to a file on a specific folder in my computer via VB. The reason for this is that I don't want to ask the user to open paint by himself and save the file, probably in the wrong location and with the wrong name. The first...
4
1930
by: dreaken667 | last post by:
I'm using this javascript: var curr_type="adherence"; function update(){ var r=document.getElementById("range").options; var range=r.value; if(range!="L7D"){ document.getElementById("compliance").disabled=false; }else{ document.getElementById("compliance").disabled=true; document.getElementById("adherence").checked=true;
10
6778
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE from Netscape. IE is ok but the Netscape browser including Firefox and Safari are not working now. Not sure why. The idea is that when you mouseover the arrows the gallery div moves to left and right. I have changed the script and now the image...
1
1343
by: nt5515 | last post by:
hey Im trying to make a game of pairs (the memory game) i have set up a grid which displays a graphic for the card back. im trying to link the edit menu to choose the graphic to be displayed. i've set up a string variable called deck which will contain the path to the required image. and actionlisteners DA and DB corresponding to which style is choosen in the menu. I had to declare the deck to some initial image so it can load. How do i...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.