www.webdeveloper.com
Results 1 to 5 of 5

Thread: Problem With Loading Graphic

  1. #1
    Join Date
    Apr 2009
    Location
    Canada
    Posts
    4

    Problem With Loading Graphic

    I'm having trouble showing a loading image between loads but only in IE.

    Code:

    Code:
    function PreLoad(){
    
    cookie = new Image();
    cookie.src = "loading.gif";
    
    }
    
    function ShowImage() {
    document.getElementById("cookie").src="loading.gif";
    
    var var1=document.getElementById("text1").value;
    var var2=document.getElementById("text2").value;
    var var3=document.getElementById("text3").value;
    var4 = document.getElementById("c1").value;
    var5 = document.getElementById("c2").value;
    var6 = document.getElementById("c3").value;
    var7 = document.getElementById("f1").value;
    var8 = document.getElementById("f2").value;
    var9 = document.getElementById("f3").value;
    var10 = document.getElementById("s1").value;
    var11 = document.getElementById("s2").value;
    var12 = document.getElementById("s3").value;
    
    
    document.getElementById("cookie").src="cookie.php?text1="+var1+"&text2="+var2+"&text3="+var3+"&c1="+var4+"&c2="+var5+"&c3="+var6+"&f1="+var7+"&f2="+var8+"&f3="+var9+"&s1="+var10+"&s2="+var11+"&s3="+var12;;
    }
    When a user clicks the button it references ShowImage() - PreLoad is used when the body loads. This works find in Mozilla browsers, but not IE. How can I get the loading graphic to show in IE?

    (ShowImage() loads a dynamically generated image-using PHP, and there is a brief pause before it is shown -- that's why I need the loading graphic). I've tried Google but to no avail.

  2. #2
    Join Date
    Jul 2005
    Location
    USA
    Posts
    912
    Isn't cookie a reserved word in browsers? Try renaming your variable. Or try setting the "lowsrc" attribute (IE only).

  3. #3
    Join Date
    Apr 2009
    Location
    Canada
    Posts
    4
    Thanks WebNerd!

  4. #4
    Join Date
    Apr 2009
    Location
    Canada
    Posts
    4
    That solved the problem!

  5. #5
    Join Date
    Jul 2005
    Location
    USA
    Posts
    912
    Which solution worked? lowsrc or renaming the variable?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles