Document.body is null in IE 8 window with jquery

I have a strange error happening only on Windows 7 and IE 8.

I am using jQuery in html. I double clicked and launched html in IE. It will show error document.body in null in the jquery library for the first time. But the error will disappear after reloading the page. Html just downloads only jquery js file and does not contain any other js or css.

It was not in another browser.

+3
source share
1 answer

It looks like an external script is loading before the body of the document can be defined. Therefore, you can simply put the part of your script that has $(document).readyat the end <body></body>.

+1
source

Source: https://habr.com/ru/post/1776865/


All Articles