问题
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