Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-02-2004, 02:47 PM   PM User | #1
tinaa
New to the CF scene

 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
tinaa is an unknown quantity at this point
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..
tinaa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:20 PM.


Advertisement
Log in to turn off these ads.