Home > Web Front-end > JS Tutorial > Solution to IE6 pop-up 'Operation terminated'_javascript skills

Solution to IE6 pop-up 'Operation terminated'_javascript skills

WBOY
Release: 2016-05-16 18:15:12
Original
1156 people have browsed it

In the actual project, my js is in the header page, and the header is referenced by multiple pages. If you add to the body element of each page, the problem can be solved. But this is too unrealistic. After all, if it is completely modified, too many files will need to be updated when deployed to the external network. So, I searched online and finally found the code that makes this js execute last. The code is as follows:

Copy code The code is as follows:


document.onreadystatechange = function(){
if(document.readyState=="complete")
{
alert('Loading completed');
}
}


I changed the alert("Loading Complete") section into the js code I want to execute finally, and finally IE6 no longer reports this error. Test IE6, IE7, IE8, and Google Chrome can all pass.
But Firefox does not support this code, because you have to add a code that only Firefox can run on the original code. The total code is as follows:
Copy code The code is as follows:

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template