JavaScript 错误“htmlfile:访问被拒绝”在表单提交上
当用户通过从 onbeforeunload
的事件处理程序调用 Javascript 命令 form.submit
来关闭 IE8 中的模式网页窗口时,尝试进行回发时,我得到错误:
“htmlfile:访问被拒绝”。
该怎么办?
<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 !!!!!!!!!!!!!!
}
}
// -->
</script>
我使用的是windows7、iis7.5、asp.net4.0。
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 !!!!!!!!!!!!!!
}
}
// -->
</script>
I am using windows7, iis7.5, asp.net4.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论