473,322 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to open a new browser page on the closing of a page

hello Everybody,

i want to open a new browser page on closing of a browser page.
for this i tried

Code:
<body onUnload="javascript:window.open("...")">

but this is not a perfect solution to do this because this code also gets executed even when a user refreshes that page.

Pls provide me the appropriate solution to my problem.
Thanks
Sep 27 '07 #1
2 1174
dmjpro
2,476 2GB
hello Everybody,

i want to open a new browser page on closing of a browser page.
for this i tried

Code:
<body onUnload="javascript:window.open("...")">

but this is not a perfect solution to do this because this code also gets executed even when a user refreshes that page.

Pls provide me the appropriate solution to my problem.
Thanks
Use .....

Expand|Select|Wrap|Line Numbers
  1. window.onbeforeunload = function(){
  2.  //your code goes here
  3. }
  4.  
Mind one thing, this will work for every browser except Opera :-)

Kind regards,
Dmjpro.
Sep 27 '07 #2
Use .....

Expand|Select|Wrap|Line Numbers
  1. window.onbeforeunload = function(){
  2.  //your code goes here
  3. }
  4.  
Mind one thing, this will work for every browser except Opera :-)

Kind regards,
Dmjpro.

Hello Dmjpro,

The code u gave gets executes even if the page is refreshed, i dont need that.
i actually want to call a method on closing of a window.

Thanks
Minay
Sep 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Dalberg | last post by:
I have a closed box system which opens an html page. The page closes by the system. I have access to the html page. I added code to open a child window from this page. However when the parent...
14
by: Gérard Talbot | last post by:
I personally disagree with the Viewable in Any browser campain. The site is frankly outdated, seems to be no longer maitained, has several recommendations that don't make a lot of sense anymore. In...
6
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On...
13
by: Seth Grimes | last post by:
Hello all, I want to open a window when a user leaves my site. I set up a function called by onUnload. To skip the window.open if the user hasn't left my site, I set a variable in my links and...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
1
by: karthik juneni | last post by:
Hi all, Iam trying to capture windows closing event (i.e) when the user clicks on the "X" button i want to capture that event and want to update some values in the database.I tried two methods...
20
by: luqman | last post by:
If user login with the login control in ASP.Net 2005 and then just close the browser and then open the browser again, the login status shows, User still Login? Any idea, how to Logout the User...
13
by: Gouri.Mahajan7 | last post by:
Hello, Can anybody please tell me how to trap the browser close event. when that is fired I want to call the web method. Thanks in advance. Regards, Gouri.
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.