JavaScript错误“无效参数”仅在IE8中

时间:2013-02-04 23:45:37

标签: internet-explorer-8 arguments

我只在IE8上收到错误,我的菜单没有在主页上加载。所有其他浏览器都很好。

IE给了我“页面错误”: -

Message: Invalid argument.
Line: 2
Char: 66850
Code: 0
URI: https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js

奇怪的是,它在Jquery中,但实际上它是一些传递给JQuery的参数,它会触发错误。

经过调查,我发现了以下一行,它引发了错误: -

"this.parentNode.insertBefore(a,this.nextSibling"

这是关于错误的,现在我不知道它在代码中触发的位置。经过一些尝试,我在我的代码中找到了一个奇怪的场景,在我创建菜单时: -

`
"node-1" : ['Overview/2','Overview/3','Overview/4','Overview/5','Overview/6','Overview/7','Overview/8','Overview/9','Overview/10','Overview/11','Overview/12','Overview/13'],


"node-2" : 
['node/2/1','node/2/4','My-Perspective/Opportunity-for-RMEP','node/2/2','node/2/5','node/2/6','My-Perspective','My-Perspective/2','My-Perspective/3','My-Perspective/4','My-Perspective/5','My-Perspective/6','My-Perspective/7','My-Perspective/8','My-Perspective/9','My-Perspective/10','node/2/7',/*'node/2/44a','node/2/44b',*/'node/2/43','node/2/44','node/2/45','node/2/46','node/2/47','node/2/48','node/2/49','node/2/8','node/2/9','node/2/10','node/2/11','node/2/12','node/2/13','node/2/14','node/2/15','node/2/16','node/2/16a','node/2/16b','Value/Transportation','Value/Transportation/1','Value/Transportation/2','Value/Transportation/3','Value/Transportation/4','Value/Transportation/4b','Value/Outbound-logistics','Value/Outbound-logistics/2','Value/Outbound-logistics/3','Value/Outbound-logistics/4','Value/Outbound-logistics/5','Value/Outbound-logistics/6','Value/Outbound-logistics/7','Value/Inbound-logistics','Value/Inbound-logistics/2','Value/Inbound-logistics/3','Value/Inbound-logistics/4','node/2/50','node/2/51','node/2/52','node/2/53','node/2/54','node/2/55'],//,'node/2/56','node/2/57','node/2/58','node/2/59','node/2/60','node/2/61'],


"node-3" : 
['My-Experts/1', 'My-Experts/2', 'My-Experts/3', 'My-Experts/4', 'My-Experts/5', 'My-Experts/6', 'My-Experts/7', 'My-Experts/8', 'My-Experts/9'],//'vince-lima','dave-mcmurray','ron-gewin','bill-parr'],


"node-4" : 
['My-Way/Potential','My-Way/Potential/2','My-Way/Requirements','My-Way/Requirements/Business-Led-Approach','My-Way/Requirements/Integrative-Transformation','My-Way/Requirements/Systematic-Waves','My-Way/Junk','My-Way/Junk/Relevant-Examples','My-Way/Junk/High-Tech','My-Way/Junk/High-Tech/2','My-Way/Junk/High-Tech/3','My-Way/Junk/High-Tech/4','My-Way/Junk/High-Tech/5','My-Way/Junk/High-Tech/6','My-Way/Junk/Retailer','My-Way/Junk/Retailer/2','My-Way/Junk/Retailer/3','My-Way/Junk/Retailer/4','My-Way/Junk/Retailer/5','My-Way/Junk/Basic-Materials','My-Way/Junk/Basic-Materials/2','My-Way/Junk/Basic-Materials/3','My-Way/Junk/Basic-Materials/4','My-Way/Junk/Basic-Materials/5','My-Way/Junk/Basic-Materials/6','My-Way/Junk/Automotive', 'My-Way/Junk/Automotive/2','My-Way/Junk/Automotive/4','My-Way/Junk/Automotive/5','My-Way/Approach','My-Way/Approach/1','My-Way/Approach/2','My-Way/Approach/3','My-Way/Approach/4','My-Way/Approach/5' ],

"node-135" : 
['Why-me/My-Capabilities/We-have-the-most', 'Why-Me/My-Capabilities/We-have-the-most-2','Why-Me/My-Capabilities/Sample-Profiles','Why-Me/My-Capabilities/We-bring-proprietary-tools','Why-Me/My-Capabilities/My-Consultants-Combine','Why-Me/My-Capabilities/My-Consultants-Combine-2','Why-Me/My-Capabilities/My-DTV-Labs','Why-Me/My-Capabilities/My-Chicago-Lab','Why-Me/My-Capabilities/IT-Systems','Why-Me/My-partnership'],

"node-145" : ['Tools/1','Tools/2','Tools/3','Tools/4','Tools/5','Tools/6','Tools/7','Tools/8','Tools/9','Tools/10','Tools/11','Tools/12','Tools/13','Tools/14','Tools/15','Tools/16','Tools/17','Tools/18','Tools/19','Tools/20','Tools/21']
`

当我删除最后一个节点(node-145)时,页面不会出现任何错误,但仍然不显示菜单。

1 个答案:

答案 0 :(得分:2)

在IE8中,打开开发人员工具,单击“脚本”选项卡,单击“开始调试”按钮,然后在浏览器中刷新页面。浏览器将执行代码,然后在导致问题的行上中断。虽然这不是您问题的具体答案,但这将更加具体,并提供有关如何修复错误的更多信息,而不是控制台中的错误消息。