none
body onunload event break mailto link RRS feed

  • Question

  • I have a very simple page that I am attempting to run in IE 9. The challenge is that when an event handler is tied to the onunload event of the body and the feedback link is clicked, the page will show the mail program but I lose the original page with the link on it. If the onunload event handler is removed from the body, it works as expected. <o:p></o:p>

    I need to figure out how to get this to work correctly (page with link stays displayed and the mail program opens) WITH the onunload event handler as the code in that event is needed for my application. any assistance would be appreciated.

    FYI - I also tested it in Chrome with the onunload event and it works as expected (i.e. email program is opened and page with the link re-displays.)

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
     <script type="text/javascript">
         
         function CallToOpener() {
    
         }
        </script>
    </head>
    <body onunload="CallToOpener()">
        <a tabindex='152' href='mailto:test@aol.com?subject=Test' >Feedback </a><br />
    </body>
    </html>
    


    George Ceaser

    Friday, May 3, 2013 5:52 PM

Answers

All replies

  • Hi,

    have you tested by turning off your popup blocker(s)?

    onunload=return false;

    for questions about html, css and scripting for website development please post to the MSDN Web Development forum.

    Questions regarding Internet Explorer 8, 9 and 10 for the IT Pro Audience. Topics covered are: Installation, Deployment, Configuration, Security, Group Policy, Management questions. If you are a consumer looking for answers or to raise a question, it's highly recommended you head on over to http://answers.microsoft.com/en-us


    Rob^_^

    Friday, May 3, 2013 10:13 PM
  • Hi,

    In addition, if this page is developed by you, you can change the website code and see how it works.

    Regards,


    Vincent Wang
    TechNet Community Support

    Tuesday, May 7, 2013 2:54 AM
    Moderator
  • @Vincent..

    he has reposted in the Web Development Forum.... apparently he did not tell us that this is a local file.


    Rob^_^

    Tuesday, May 7, 2013 4:48 AM
  • Sorry - I have posted this in the forum recommended.  The return false does nothing.  I had already tried that.  thank for everyone's help.  I will mark this one resolved.

    http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/ade21ba9-1121-4f3c-91f9-23499bc65042


    George Ceaser

    • Marked as answer by George Ceaser Tuesday, May 7, 2013 12:52 PM
    Tuesday, May 7, 2013 12:52 PM