Click here to Skip to main content
15,894,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I'm using window.onload to fire a javascript function which works fine when you first load the page.

If you click on the URL in the address bar and press enter it works fine.

However if you click refresh button, the status bar say's done but the loading circles keep spinning as if the page is still loading.

Then if you click anywhere on the page it stops. I have left it going for 15 minutes maybe.

Firefox works fine, but I can't use firefox on the network it's running on so I need to solve the problem.

I'm running IE8, but I haven't been able to check it on any other machines yet.
Posted
Updated 3-Nov-10 10:17am
v2
Comments
Kythen 3-Nov-10 17:33pm    
Try using the debugger in the IE8 Developer Tools to break into the code while the page is doing the "sit and spin" thing. You should be able to see if your javascript code is getting stuck somewhere, or if IE is just being retarded.

what happens if at the end of your onload event you add a control.focus() command to emulate the mouse click. It may shock the browser into working. I haven't tried this, just a brainstorming idea workaround.
 
Share this answer
 
Thanks guys, I seem to have narrowed it down a little with your advice,

I have a function in the script that it seems to get hung on:
<pre lang="cs">function FixIE(el){
if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false)
    el.style.display="inline-block";
    alert("IE");
}



It alert's 3 times which is correct as there are 3 elements that the function is processing. Once you ok these the page loads fine no more spinning logo's....

I've tried setting focus at a few points but doesn't seem to be doing the trick.

Obviuosly this is only hanging on page refresh..
 
Share this answer
 
UPDATE
-----------------

<pre lang="cs">

window.onload=function(){
           functionname();
alert("setting Focus1");
document.getElementById("editbutton").focus();

                }



The above code works, however if I remove the alert it fails???

I am very new to javascript so please bear with me...
 
Share this answer
 
Just for the record if anybody else has this issue it was IE.

Worked fine on another PC.

Re-installed IE on mine and yeah it worked.....
 
Share this answer
 
Comments
fjdiewornncalwe 4-Nov-10 7:27am    
Gotta' love it when that happens....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900