Hi, while i know how to get the domain of the referrer (i.e. document.referrer), I don't know how to get the entire URL of the referrer.
Does any1 have an idea as to how this might be done?
Cheers. Scot-bot.![]()
| SitePoint Sponsor |
Hi, while i know how to get the domain of the referrer (i.e. document.referrer), I don't know how to get the entire URL of the referrer.
Does any1 have an idea as to how this might be done?
Cheers. Scot-bot.![]()


document.referrer should give you the full URL, not just the domain name. Do you have an example that is doing otherwise?
I'm working off a local copy of IIS, so when I say alert(document.referrer) it returns the domain only, which happens to be set-up as the name of my PC.
Is it possible to get the url of the last page visited in the history, whether it was forward or back in it?
Cheers. Scot-Bot.![]()


Aha, a local copy. I've seen document.referrer not work when browsing files locally, but when uploaded to a remote web server, it works. My local machine is also running IIS, but it still won't show the referrer until I upload my files. If possible, see if it makes any difference. Not sure why this happens.
Other than that, it should show the full URL of the page visited before landing on your page with document.referrer in it. You can't dig into the user's history, for security reasons.
Thanx for the tips, guys. Unfortunately, though I'm using IIS to develop the site, the site will in the end run on an Apache-Solaris server.
I'm only using Microsoft because I'm more comfortable with it than Unix. So, I can't use ASP to solve the problem: the other web-developer is doing all that nasty Perl/CGI stuff. I can't even do any SSJS.
Ta, anyway. Scot-Bot.![]()
Bookmarks