This problem only occurs in IE8 on Windows 7. It does not occur in IE8 in any previous version of windows.
I have a simple page which includes an iFrame control who's source is a second simple page. The second page has an "onbeforeunload" event and some javascript to run for that event. This event simply attempts to do "document.forms[0].submit()". Prior to Windows 7, this code worked. However with Windows 7 the code exceptions on the submit call with an "Access Denied" error.
I have browsed other similar questions, and what few there are have suggestions of browser security setting. I have lowered the settings in the browser to "low", yet the error still occurs. The two pages in question are below, there is no code behind.
Default.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<html>
<head>
<title>Testing</title>
</head>
<body>
<form id="Default">
<iframe src="VarInfo.aspx"></iframe>
</form>
</body>
</html>
VarInfo.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="VarInfo.aspx.vb" Inherits="WebSite1.VarInfo" %>
<html>
<head>
<title>simple page</title>
<script language="javascript" type="text/javascript">
<!--
function BeforeClose()
{
try
{
alert('saving');
document.forms[0].submit();
alert('saved');
}
catch(e)
{
alert('Error submitting: ' + e.message);
}
}
//-->
</script>
</head>
<body onbeforeunload="BeforeClose();">
<form id="VIForm">
<div>
VarInfo Page
</div>
</form>
</body>
</html>
Would greatly appreciate any help with this one!




LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks