Reputation: 69
We are facing a problem using Internet Explorer 7. In ASP.NET MVC 3 the result page looks like:
<button type="button" onclick=" ShowOperation('/Page/Box/ShowOperation/CreateBox', '') ">...
and the error (in IE7 only) looks like:
Error: The value of the property 'ShowOperation' is null or undefined, not a Function object.
This function has been defined in file page.js which we attach externally
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;
}
Upvotes: 0
Views: 116
Reputation: 3333
Since the function is defined in another js file, you need to add javascript:
before the function name while calling in onclick.
Your updated code would look somehow like this:
<button type="button" onclick="javascript: ShowOperation('/Page/Box/ShowOperation/CreateBox', '');">
Upvotes: 2