javascript 无法获取属性“get”的值:对象为空或未定义

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10927724/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 11:30:06  来源:igfitidea点击:

Unable to get value of the property 'get': object is null or undefined

javascriptinternet-explorermagento

提问by Luis Valencia

my site www.theprinterdepo.com its a magento oscommerce site As you know its open source, I didnt developed it.

我的网站 www.theprinterdepo.com 它是一个 magento oscommerce 网站 正如你所知,它是开源的,我没有开发它。

It loads perfect in chrome and firefox, but I am receiving this javascript error in internet explorer 9.

它在 chrome 和 firefox 中完美加载,但我在 Internet Explorer 9 中收到此 javascript 错误。

Unable to get value of the property 'get': object is null or undefined

无法获取属性“get”的值:对象为空或未定义

I tried to debug and found that the problem is it prototype.js

我尝试调试,发现问题是prototype.js

prototype.js, line 516 character 1

prototype.js,第 516 行字符 1

The line where it fails its:

它失败的那一行:

var respondersForEvent=registry.get(eventName);if(Object.isUndefined(respondersForEvent)){respondersForEvent=[];registry.set(eventName,respondersForEvent);}
if(respondersForEvent.pluck('handler').include(ha

Obviously, because this is a library, I dont want to modify it my self.

显然,因为这是一个库,我不想自己修改它。

I am looking for suggestions in what to do in this case based on your experience?

我正在根据您的经验寻找在这种情况下该怎么做的建议?

采纳答案by beeglebug

There are lots of known issues with Magento and IE9 unfortunately, an accepted solution to the problem issue is to use a meta tag such as:

不幸的是,Magento 和 IE9 有很多已知问题,该问题的公认解决方案是使用元标记,例如:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

Placed immediately after the title tag. See this blog postfor more details.

紧跟在标题标签之后。有关更多详细信息,请参阅此博客文章