document.body.appendChild(i)

后端 未结 6 1339
傲寒
傲寒 2020-12-08 19:50

I am getting error only in IE7 as document.body is null; when I debug with Microsoft script editor I am getting the error in the following line: i.e.

6条回答
  •  一个人的身影
    2020-12-08 20:24

    You could try

    document.getElementsByTagName('body')[0].appendChild(i);
    

    Now that won't do you any good if the code is running in the , and running before the has even been seen by the browser. If you don't want to mess with "onload" handlers, try moving your

提交回复
热议问题