User Name Password Register
DaniWeb IT Discussion Community
All
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 362,337 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 4,580 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

Whether it is possible to find the response url in java script

Join Date: Jul 2006
Location: Deptford, London
Posts: 916
Reputation: MattEvans will become famous soon enough MattEvans will become famous soon enough 
Rep Power: 4
Solved Threads: 45
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: Whether it is possible to find the response url in java script

  #6  
Sep 13th, 2007
When the link has been clicked, put its' id ( or better, the object itself, or its href, or whatever ) in a global variable.
...
<script type="text/javascript">
var last_link = 0;
function unloading()
{
  if( last_link != 0 ){ ... }
}
function set_last_link( obj )
{
  last_link = obj;
}
</script>
</head>
<body onunload="unloading( );">
....
<a onclick="set_last_link( this ); return true;"/>
...

You might be better off using a javascript-controlled cookie all throughout the site; ie. on every page onload event, read the last URL from the cookie, do whatever you'd intend do when the previously loaded page was unloaded, then write the current URL to the cookie. That way, whenever the user moves between pages, you can find out where they came from. That's gotta be more useful, and flexible, and I can't think of any situation where that would be less suitable than trying to find out where the user is going.
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
All times are GMT -4. The time now is 11:06 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC