•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,808 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,474 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3809 | Replies: 1
![]() |
•
•
Join Date: Aug 2005
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 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 :
[html]
<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();">[/html]
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 :
[html]
<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();">[/html]
Last edited by tgreer : Aug 29th, 2006 at 9:48 am. Reason: User ignored rules about code tags.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
ajax asp beta bon browser browsers browsing developer development echo email encryption europe firefox gecko home html internet internet explorer internet explorer 7 javascript leak linux memory microsoft mozilla msdn networking news office open source open-source patch phishing scams security site social software sql super testing users vista web webmail
- Creating an event or an action to a button. (PHP)
- Microsoft Internet Explorer Wont Allow to Close (Web Browsers)
- Windows program closing automatically on opening- HIJACK LOG posted (Viruses, Spyware and other Nasties)
- wanna help..how to avoid default context menu (JavaScript / DHTML / AJAX)
- HJT log please check, causing serious boot probs (Viruses, Spyware and other Nasties)
- scanned with hijack. what do I fix?? (Viruses, Spyware and other Nasties)
- Loing authentication fields from 2 tables? (ASP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: DateTime - TimeZone conversion with Javascript. Partially working!
- Next Thread: Copy text to clipboard


Linear Mode