Does IE7 not fully support javascript's insertBefore method?

时间秒杀一切 提交于 2019-12-04 07:04:46
user210099

Rather than leave this problem unsolved, I figured out what was wrong with my code:

I was using an extensive frameset(yuck!!) and when I made the text_node = document.createTextNode() call, I was not doing this in the frame that my application was in.

I fixed this by explicitly calling out the frame to create the object in:

var text_node = MainFrame.child_frame.WhySoManyFrames.document.createTextNode(p1);

After doing this, the insertBefore method works perfect!

Hopefully this helps anyone looking at this question- I know this took me a long time and lots of frustration to figure out!

JavaScript 'InsertBefore' function is supported by IE7. Remember that you have to use this function only when page is fully loaded!

Details

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!