Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer IE works from C: but not from internet

    www.cecenter.org

    I made a very simple ticker to approximate how much energy we have saved our clients. It works fine when I tested it just from the C drive. When I put it on the site it worked fine on FF but not IE. In fact, IE would load half the site and then say that it could not load the site, and then give an error page. If I hit "refresh" the site then shows up properly. Very strange?

    It is particularly confusing because it will give an error every-other-time that I reload the page.

    Here is my code:

    Code:
    <script type="text/javascript">
    function doSomething()
    {
    	var allsecs = new Date()
    	var time = allsecs.getTime()	
    	var timeadjust = time - 1166832000000;
    	moneysaved = 270000000 + .000475647 * timeadjust;
    	moneysaved = moneysaved.toFixed(2);
    	 
    	var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
    	while(sRegExp.test(moneysaved)) 
    	{
    		moneysaved = moneysaved.replace(sRegExp, '$1,$2');
    	} 
    	
    	document.getElementById("numchange").innerHTML = moneysaved;
    }
    
    setInterval ("doSomething()" , 1000 );
    doSomething();
    
    </script>
    This is the doctype:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

    Anyone have any ideas?

  • #2
    Regular Coder mjlorbet's Avatar
    Join Date
    Jan 2008
    Location
    Milwaukee, WI
    Posts
    724
    Thanks
    8
    Thanked 96 Times in 95 Posts
    change
    Code:
     
    setInterval ("doSomething()" , 1000 );
    doSomething();setInterval ("doSomething()" , 1000 );
    doSomething();
    to
    Code:
     
    window.onload = function(){setInterval("doSomething()", 1000);};
    and see if the results are different. if they are (and it works) then you've found a glitch in the ie js parser, basically the extended load time from the server is allowing the script to execute faster than the content is received, possibly causing ie to bug out & go to that message, the reason it would work on the refresh is that the page is already cached but it doesn't recognize this as it hasn't displayed it yet, the following refresh would give an error because it is trying to update content & would find the same problem. if that is the case (which i kind of doubt) then that would fix it for you. if it doesn't work, comment out that line, re-upload, clear your cache and visit the site again. if the error still occurs it likely has to do with the headers your php is returning and not the script, if it doesn't then ie just doesn't like the body of your function.
    -Mike
    "Want me to precludify him, like some kind of dispatcherator?... Can do!" -Bender


  •  

    Posting Permissions

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