未定义Javascript数组,对象,日期 [英] Javascript Array, Object, Date not defined

查看:82
本文介绍了未定义Javascript数组,对象,日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有史以来最奇怪的情况,但是我已经在三台PC上重现了它.只会在Internet Explorer 9中发生(不是8,只有9).

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

它发生在我朋友的网站上,这不是插件,而是网址:带有JavaScript的IE的错误

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

当您单击其中一个链接时,就会发生魔术错误,例如"Nog fiscaal interessant ..."

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

这将打开一个弹出窗口,其中包含托管电影播放器​​的iframe.电影帧在IE9中抱怨对象未定义",数组未定义",日期"未定义.

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.

可能会发生什么?

推荐答案

最后通过动态加载iframe来解决.

Finally solved by loading the iframe dynamically.

该解决方案位于 http://code.google.com上/p/simplemodal/issues/detail?id = 73

在此处复制/粘贴以供将来参考:

Copy/paste here for future reference:

我认为这个问题更多与IE9如何处理iframe和 随后加载javascript ...我的解决方法是设置 iframe src仅"onShow"回调函数,而我以某种方式停止了 得到那些对象未定义的错误.希望这会有所帮助.

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"); }

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

实施的解决方案是在完全渲染弹出窗口之后加载iframe src,而不是先加载iframe然后显示弹出窗口.

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.

感谢所有调查人员!

这篇关于未定义Javascript数组,对象,日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆