Snehal Rana
asked on
Create an Exit link which returns users to referring page
We are using SharePoint 2007. The users come to my site from a link setup on another site. I need to create an Exit link on the header of my main Site collection. When user clicks on this Exit link they should be send to the site or page they came from.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Posted the tutorial over at: http://www.johnchapman.name/jquery-return-user-to-referring-url-exit-linkbutton/
ASKER
I am testing this out as I write. Appreciate quick response.
ASKER
Hi Chapmanjw,
I tried inserting this code on default.aspx and it errors out as below:
" '$' is undefined"
Let me know
I tried inserting this code on default.aspx and it errors out as below:
" '$' is undefined"
Let me know
ASKER
Excellent solution by chapmanjw. Got this working with little tweak. I needed to place both the js files in appropriate location and it worked like a charm.
Thanks a bunch
Thanks a bunch
1) Get the referring URL (document.referrer)
2) Set a cookie with the the referring URL (here is info on how to set a cookie in JavaScript: http://www.quirksmode.org/js/cookies.html)
3) Create a function that enables the Exit link if a referring URL cookie is set
4) Set the link to call a JavaScript function that reads the cookie and redirects the user to the referred page.
Ill write up a tutorial for this, but just wanted to put this out there so that you had somewhere to start in the meantime.