Keeping Track Of The Referrer In Javascript
This Javascript code will add a handler to a cancel button on a form, so that when the button is clicked the user is returned to the page that requested the form.
This is useful when you have more than one route to a form, such as an edit link on a table or an edit link on a details screen.
The script uses a cookie to remember where the user comes from. It also handles the case where the referrer is the form itself, i.e. with struts validation the form may be displayed several times.
First of all saveReferrer() needs to be called on page load.
You'll need a function to retrieve the referrer.
Finally, the cancel button needs on onclick handler.
Posted on Tuesday, Jul 11, 2006

0 Comments
Leave a Comment