tinaa
08-02-2004, 02:47 PM
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
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