Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to reset event handler for an inline frame (iframe) for IE

    Hi, there:
    I'm writing a test for html files. In my main dtml file, I added an inline frame, like this:
    <iframe NAME="myiframe" ID="myiframe" SRC="/"></iframe>

    In my main dtml file, I want to write javascript code to reset the onbeforeunload event handler of "myiframe" to something else, or even to null, but it never works. The code is like this:

    document.getElementById('myiframe').contentWindow.window.onbeforeunload = SomeFunctionNameIDefined;

    Strangely enough, no matter what I set it to be, the value of onbeforeunload is always null.

    This actually works for Mozilla. And also, if I add "window.onbeforeunload = SomeFunctionNameIDefined" in the code of "myiframe" code ( not main dtml file ), it works fine as well.

    So I wonder is there something wrong with the DOM??

    Thanks A LOT!!!!


    Tina
    TinaJie@yahoo.com
    Last edited by tinaa; 08-02-2004 at 02:49 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •