473,473 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to sniff the requested URL

i need to add a function to body's onUnload to see which URL has been
requested. if it isn't the same as the current page, i want to ask the user
if they would like to save their changes first. i can use location.href to
get the current page, but is it possible to determine what the requested URL
is prior to unloading the page?

tks
Jul 23 '05 #1
2 3391
Dica wrote on 24 mrt 2005 in comp.lang.javascript:
i need to add a function to body's onUnload to see which URL has been
requested. if it isn't the same as the current page, i want to ask the
user if they would like to save their changes first. i can use
location.href to get the current page, but is it possible to determine
what the requested URL is prior to unloading the page?


The next page is not accessible to any unload routine.

Wouldn't you think that would be a serious security risk?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2


Dica wrote:
i need to add a function to body's onUnload to see which URL has been
requested. if it isn't the same as the current page, i want to ask the user
if they would like to save their changes first. i can use location.href to
get the current page, but is it possible to determine what the requested URL
is prior to unloading the page?


There is no general way to know that, certainly if the browser user
types a new URL in the address bar then script doesn't know the new URL.
If you have links in your document you can however use a document wide
onclick handler and check whether a link was clicked, what href it has.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Glawster | last post by:
Is anyone using SNiFF+ to develop and debug Python applications, I would welcome some setup advice for debugging. I am using Sniff version 4.0.1. Regards, Andy
6
by: Aaron | last post by:
IIS 5.0 is throwing out "The requested resource is in use." for any site that uses ASP - HTML is executing fine. I have tried re-installing scripting, latest MDAC, and all my hotfixes are up to...
0
by: Polaris | last post by:
Hi: Does .NET Framework (C#) provide any user mode functions which can "sniff" the network wire. For example, detecting all HTTP traffic on a network card? I know this kind of thing is usually...
1
by: Frank Lopez | last post by:
In .NET and C#, is there anyway to create a hook for a specific directory or file where my C# .NET software can monitor which static web files are requested by the browser? What I am doing is...
2
by: Anony | last post by:
Hi All, I used raw socket to sniff packet data. Now it can sniff only incoming packet, not outgoing data anymore. I don't know if it's due to the installation of XP SP2, firewall or other...
2
by: Nobody | last post by:
If I request: http://www.test.com/ which is implictly: http://www.test.com/index.aspx Request.Url contains the index.aspx portion regardless of whether or not the client requested the...
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: Is there some one can Tell me how can I sniff the IP address for any remote computer ? any help or redirection for any artical will be appecated regard's husam
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: Is it true that when I want to sniff a certine IP from my machine that I have to be apart of network, and If some security Devices such as Firewall and routers if them configuered...
1
by: kavok | last post by:
I am writing a software that needs to sniff packets in the network (raw ethernet) and also, with another thread send regular UDP packets with the common socket API's. However, when the RAW...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.