-
August 20th, 2009, 03:33 PM
#1
javascript/chrome onunload issue
Code:
var win = window.open(page,'window','width=270, height=155, left=300, top=200');
alert('1');
win.onunload = function()
{
alert('2');
}
Consider the above code:
In firefox, I see the new window popup, get a '1' alert, then close the popup window, then see the '2' alert.
In chrome, I see the new window popup, get a '1' alert, then additionally get the '2' alert immediately following the '1'.
When I close the chrome window I get no alerts.
What is the reason for this and how can I resolve this issue?
-
August 20th, 2009, 05:00 PM
#2
Re: javascript/chrome onunload issue
Remember that they have two separate JavaScript engines. In my version of Firefox, the second alert does not fire. What version of Firefox are you running?
Last edited by PeejAvery; August 20th, 2009 at 05:15 PM.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|