Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Windows 7 problem with submit in onbeforeunload event in IE

$
0
0

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

<%@PageLanguage="VB"AutoEventWireup="false"CodeFile="Default.aspx.vb"Inherits="_Default"%><html><head><title>Testing</title></head><body><formid="Default"><iframesrc="VarInfo.aspx"></iframe></form></body></html>

 VarInfo.aspx

<%@PageLanguage="vb"AutoEventWireup="false"CodeBehind="VarInfo.aspx.vb"Inherits="WebSite1.VarInfo"%><html><head><title>simple page</title><scriptlanguage="javascript"type="text/javascript"><!--function BeforeClose()
      {try
        {
          alert('saving');
          document.forms[0].submit();
          alert('saved');
        }catch(e)
        {
          alert('Error submitting: ' + e.message);
        }
      }//--></script></head><bodyonbeforeunload="BeforeClose();"><formid="VIForm"><div>
        VarInfo Page</div></form></body></html>

Would greatly appreciate any help with this one!


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>