Javascript Array, Object, Date not defined

徘徊边缘 提交于 2019-12-12 20:23:17

问题


Strangest situation ever, but I've reproduced it on three PCs already. Only happens in internet explorer 9 (not 8, just 9).

It happens at the site of my friend, this is not a plug, but here is the url: IE bug with javascript

The magic error happens when you click one of the links, for example "Nog fiscaal interessant ..."

This opens a popup, with inside an iframe that hosts a movie player. The movie frame complains, in IE9, about "Object not defined", "Array not defined", "Date" not defined.

What could be going on?


回答1:


Finally solved by loading the iframe dynamically.

The solution was found on http://code.google.com/p/simplemodal/issues/detail?id=73

Copy/paste here for future reference:

I think this issue is more to do with how IE9 handles iframe and subsequent loading of javascript in it... my workaround was to set iframe src only 'onShow' callback function and somehow i stopped getting those object undefined errors. Hope this helps.

function onShow(){ jQuery("iframe").attr("src", "/goto/site"); }

Another link with possibly more info: http://msdn.microsoft.com/en-us/library/gg622929%28v=VS.85%29.aspx?ppud=4

The solution implemented was loading the iframe src after the popup had fully rendered, instead of first loading the iframe and then showing the popup.

Thanks to all investigators!



来源:https://stackoverflow.com/questions/10898487/javascript-array-object-date-not-defined

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