Advertisement

05.16.2008 at 03:25PM PDT, ID: 23409913
[x]
Attachment Details

Javascript warning when closing a window

Asked by SWB-Consulting in JavaScript, Internet Explorer Web Browser, Dynamic HTML (DHTML)

Tags: html, ie, -

I have an HTML page. When the user closes the browser, I would like for it to pop up a message asking the user if he is sure he wants to close. But I don't want this message to show up if the user hits the back button. Is this possible?Start Free Trial
[+][-]05.16.2008 at 03:42PM PDT, ID: 21587005

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Internet Explorer Web Browser, Dynamic HTML (DHTML)
Tags: html, ie, -
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.19.2008 at 03:59AM PDT, ID: 21596539

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.11.2008 at 11:52PM PDT, ID: 21987955

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 05:22AM PDT, ID: 21988821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 09:27AM PDT, ID: 21999572

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 09:47AM PDT, ID: 21999739

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 09:54AM PDT, ID: 21999814

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 09:36PM PDT, ID: 22022386

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.16.2008 at 03:42PM PDT, ID: 21587005
>> Is this possible?
No.
1. You cannot determine if the Back Button was clicked
2. The event that would trigger the popup is triggered every time the browser is about to "clear/destroy" the "content area" so it would trigger if you were to leave the site OR click on any link (even those pointing to your own site OR closing the browser OR clicking the back button).
Accepted Solution
 
05.19.2008 at 03:59AM PDT, ID: 21596539
A Google search for

detect back button

returned several matches, one being

http://www.willmaster.com/library/javascript/detecting_a_back_button_click.php

I am not sure any of these methods are 100% foolproof, but...
 
07.11.2008 at 11:52PM PDT, ID: 21987955
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: hielo {http:#21587005}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

b0lsc0tt
EE Cleanup Volunteer
 
07.12.2008 at 05:22AM PDT, ID: 21988821
Why not split the points?
 
07.14.2008 at 09:27AM PDT, ID: 21999572
Badotz,

Thanks for your response and participation here.  The comment you posted to help had interesting info.  I liked the article.  However I did not include your post in my recommendation because I don't see how that info can be adapted to be used as an answer here.  In a different question it might've been the perfect answer for a member but unfortunately that script doesn't provide something that would help for what the member is asking here.  I did look at this close but let me know if you feel I overlooked something in your post the will help for this specific question.  If you feel that script could be easily adapted or used in a different way to provide the result the Asker wants then feel free to elaborate.

Thanks again for the participation here and all your time helping EE members.  I really did enjoy what you found.

b0lsc0tt
EE Cleanup Volunteer
 
07.14.2008 at 09:47AM PDT, ID: 21999739
>>But I don't want this message to show up if the user hits the back button.

From the link:

"I know of no way to detect the actual click on a browser's "back" button."

That should have been enough to show the Asker it was not possible, and to review other verifications from Google.
 
07.14.2008 at 09:54AM PDT, ID: 21999814
Badotz,

I thought you posted the link to provide an option that may work.  If you just meant it to answer it wasn't possible then that answer was already posted by an expert.  There is no reason to split when a comment just provides the same answer as a previous expert's post, especially when nothing is really added and no credit given.

I still did find it interesting and go more out of it than just the part you quoted above.  I guess I read more into why you posted the link but I would definitely not recommend a split when a comment just duplicates another's post.  Thanks again for the participation and all your help here.  Let me know if you have a question about this or still have an objection.  The admin who closes this will definitely review these posts and may decide to not follow my recommendation so don't feel it is in vain or your opinion doesn't count.  I do appreciate your responses.  I'll see you around. :)

b0lsc0tt
EE Zone Advisor
 
07.16.2008 at 09:36PM PDT, ID: 22022386
Forced accept.

Computer101
EE Admin
 
 
20080716-EE-VQP-32 / EE_QW_2_20070628