Javascript error "htmlfile: Access is denied" on form submit
When trying to do post back when the user press to close my modal web page window in IE8 by the Javascript command form.submit
calling from the event handler of onbeforeunload
, I get the error:
"htmlfile: Access is denied".
What to do?
<script language='javascript' for='window' event='onbeforeunload()'>
if (this.event.clientY<0){__doPostBack('__Page','__close')}
</script>
<script type="text/javascript">
<!--
var theForm = document.forms['MyModalForm'];
if (!theForm) {
theForm = document.MyModalForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();//ERROR: Access is denied !!!!!!!!!!!!!!
}
}
// -开发者_JS百科->
</script>
I am using windows7, iis7.5, asp.net4.0.
精彩评论