0

Hi guys,

i'm new to JS and need a little help on this issue of mine.....

i'm trying to popup a confirm dialog box whenever i close my browser window,the problem is that i'm able to do this in IE but i'm having problems when i'm using firefox.i'm doing this using the "onbeforeunload" event.........

Please do gimme a solution to this problem in forefox and also let me know y this is happening.................


The script that i've ritten is :

<script language="JavaScript">

function ConfirmLeaving()
{
    if (event.clientY < 0 && event.clientX > 600)
    {
         var answer = confirm ("do u want to go to google?");
         if (answer)
         {
            window.open("http://www.google.com");
         }
    }
}
</script>

</HEAD>
 <body onbeforeunload="ConfirmLeaving();">
2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by mostafadotnet
0

Hi fuehrer,
if you check this code using firefox in Javascript Console,you'll figure out that it throws this error:

Error: event is not defined

So,it won't work in firefox till you change the onbeforeunload event.
Good luck.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.