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:
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:
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31