Javascript IE7 asp.net mvc加载错误
我们在使用Internet Explorer 7时遇到问题。 在ASP.NET MVC 3中,结果页面如下所示:Javascript IE7 asp.net mvc加载错误,javascript,asp.net,asp.net-mvc,internet-explorer,Javascript,Asp.net,Asp.net Mvc,Internet Explorer,我们在使用Internet Explorer 7时遇到问题。 在ASP.NET MVC 3中,结果页面如下所示: <button type="button" onclick=" ShowOperation('/Page/Box/ShowOperation/CreateBox', '') ">... 此函数已在外部附加的文件page.js中定义 function ShowOperation(operationUrl, type) { if (type && typ
<button type="button" onclick=" ShowOperation('/Page/Box/ShowOperation/CreateBox', '') ">...
此函数已在外部附加的文件page.js中定义
function ShowOperation(operationUrl, type) {
if (type && type == 'download') {
var temp = $("#pageGrid").jqGrid('getGridParam', 'selarrrow');
if(temp.length == 0) {
ProceedAjax(operationUrl, AjaxWarning);
return;
}
$("#doOperation").attr("action", operationUrl);
var uu = operationUrl.split("/");
var action = uu[uu.length-1];
$("#doOperationAction").val(action);
$("#doOperationIds").val(temp);
$("#doOperation").submit();
return;
}
ProceedAjax(operationUrl, AjaxError);
return;
}
由于该函数是在另一个js文件中定义的,因此在调用onclick时,需要在函数名之前添加
javascript:
。更新后的代码看起来是这样的:
<button type="button" onclick="javascript: ShowOperation('/Page/Box/ShowOperation/CreateBox', '');">
这在JavaScript中似乎是一个未定义的函数,JavaScript方法
ShowOperation
从何而来?将其添加到母版页上。不幸的是,它没有起作用
<button type="button" onclick="javascript: ShowOperation('/Page/Box/ShowOperation/CreateBox', '');">