Javascript代码对象预期错误

时间:2011-09-09 19:14:18

标签: javascript jquery

我在运行时收到此错误可以任何正文帮助我解决为什么我收到此错误?

由于

ShowHelpTopic('/Help/Help2.htm');;void(0)

这是我在动态模式页面中遇到的错误。

这是我在页面中的代码。

stm_aix("p3i0", "p1i0", [0, "Searching for items in Benefit Code list", "", "", -1, -1, 0, "javascript:ShowHelpTopic('/Help/Help1.htm')", "_self", "", "Help Topics", "060508icon4.gif", "060508icon5.gif"], 526, 0);stm_aix("p3i0", "p1i0", [0, "Creating new Benefit Codes", "", "", -1, -1, 0, "javascript:ShowHelpTopic('/Help/Help2.htm')", "_self", "", "Help Topics", "060508icon4.gif", "060508icon5.gif"], 526, 0);

我的js文件中的ShowHelpTopic函数。

function ShowHelpTopic(url){
    window.open(url, "HelpTopics", "height=600,width=900,resizable=1,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0");
}

为什么我的asp.net mvc应用程序出现运行时错误?

1 个答案:

答案 0 :(得分:1)

当您将urls添加到自身或item为空时,var urls = "", item = {helpLinkDescription: 'a', helpLink1: 'google'}; urls += 'stm_aix("p3i0", "p1i0", [0, "' + item.helpLinkDescription + "\", \"\", \"\", -1, -1, 0, \"" + "javascript:ShowHelpTopic('" + item.helpLink1 + "');" + "\", \"_self\", \"\", \"Help Topics\", \"060508icon4.gif\", \"060508icon5.gif\"], 526, 0);"; 不存在。因为这个样本很好:

{{1}}