Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2005, 01:34 AM
Authorized User
 
Join Date: May 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Back button pressed -Urgent

Hi ALL
Urgent requirement..........
If the back button is used how to present t the user with pop-up window?.

 
Old September 28th, 2005, 09:52 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can use the onbeforeunload or onunload event to trap the page being left but there's no specific way to know if it was because of the back button or just the browser going elsewhere or being closed.

A popup now though will be blocked by most blockers including IE6 in normal mode as it is event triggered rather than user initiated.

Please don't mark posts as Urgent, especially all your posts.
Everyone's problems are urgent to them and you could easily have Googled for this if it were that important.

--

Joe (Microsoft MVP - XML)
 
Old September 29th, 2005, 12:07 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii mikedeepak!!!

 You can trap the back button at some extent.
Whenever page unload put it's page identity value in cookies.
Whenever user click on the back button check whether page identity is on/off.If on then put ur javascript alert/popup in ur page onload method.Again be sure to remove cookies value when user closes the browser or logout from your website.
Note;-User can disable cookies.

If you have any other alternatives plz let me know
Hope this will help you



Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
block browser back button in asp.net URGENT naeem_ul_hussan Classic ASP Professional 2 August 3rd, 2007 11:40 AM
How to open a popup when back button is pressed Vadivel Javascript How-To 1 May 12th, 2006 03:08 AM
"Pressed button" selector with onload refresh marcioschilling Javascript How-To 0 May 31st, 2005 01:37 PM
Executing a file when button pressed scoobie Pro PHP 1 May 10th, 2005 05:35 AM
history.back or hitting the back button won't work lian_a Classic ASP Basics 4 July 29th, 2004 12:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.