Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    JavaScript


Document Referrer

does anyone know if there is anything wrong with this code?

!= -1){ document.write("")}

View 5 Replies (Posted: September 28th, 2006)

Sponsored Links:

Related Forum Messages For JavaScript category:
if I put alert(document.referrer) in code of a file that was linked from another it returns blank... pls, need to get document.referrer, don't why it's not working... read up on oreilly, don't know what I'm doing wrong..

Posted: July 23rd, 2005

View 9 Replies!   View Related
Document.referrer Does Not Display
This is my first time messing with the document.referrer tag in javaScript, and I'm afraid it's giving me some trouble. It all seems very simple and I'm having no problem getting the other document methods to work, but this one just refuses to get in line. Here's my test code:


<title>refer test</title>


<!-- Hide script from old browsers

document.write('<P>Here's the URL: ' + document.URL);

document.write('<P>Here's the last modified info : ' + document.lastModified);

document.write('<P>Here's the referrer: ' + document.referrer);

//-- Stop hiding script -->

The document.URL and document.lastModified work fine, but referrer never shows up. Can anyone tell me what I'm doing wrong here?

Posted: Nov 23, 2005, 13:38

View 2 Replies!   View Related
Chrome Does Store Document.referrer?
Chrome creates new process for each instance(click to any _blank url). The new instance doesn't get 'document.referrer'.

How I can get it for Chrome? (This problems is only for Chrome)

You can create simple links and page.

This page contain next text:
<script language="javascript" type="text/javascript" charset='UTF-8'>
document.write('<b>Referrer Is: </b>');


Posted: February 6th, 2010, 10:07 AM

View 2 Replies!   View Related
Getting Document.referrer Past The Ampersand In URL
When using document.referrer to get the referring URL it only sees up to the ampersand


Is there any way to get the rest of the URL?

Posted: Mar 14, 2002, 02:41

View 3 Replies!   View Related
JQuery :: Document.referrer For A Splash Effect?
I'm trying to create a splash page effect on my index page by adding some full screen images with jquery. I got that to work, but I only want to call the script if a person is arriving at the homepage after coming from an external site. I think I can use document.referrer in something like this:


But it's not working I'm very new to javascript .

Posted: 21-Jul-2010

View 2 Replies!   View Related
Get Complete Url From Document.referrer When There Are Some Special Characters In It?
How can I get the complete url like [URL] using something like document.refrerrer if it did come from [URL]document.referrer only return [URL] instead of full path. I guess special characters(#!) make this happened.

Posted: Aug 14 11 at 7:18

View 1 Replies!   View Related
Internet Explorer - Document.referrer Empty In IE After Redirect?
I'm linking to a page (page1) which performs a redirect the final page (page2). But on page 2 the document.referrer property is empty but only in I.E because of the redirect.

Page A simply as a link to Page B. Page B uses window.location to redirect to the url for Page C. But as stated the document.referrer property is empty in Page C after the redirect from Page B this is only the case in I.E.

Also - I am only using http not https

Posted: Jun 24 11 at 13:38

View 1 Replies!   View Related
Use "document.referrer" In IFrame URL?
We have embedded tutorial youtube videos for new members of a forum, and would like to incorporate an iFrame which loads the referring forum page on our tutorial page, when they click a help video link. This would allow members to pause the video, and actually try out the instructions on the forum page they were on, without having to either tab back and forth, or having two browser windows open. We tried using popup videos, but didn't work well for our purposes.

Is there a way to load a referring page in an iFrame such as:

<iframe src="document.referrer" style="width: 640px; height: 480px" name="forumvids"></iframe>

Nothing has worked so far. We end up just getting a blank iFrame window.

Posted: Sep 6 11 at 21:25

View 2 Replies!   View Related
Parse The Referrer
Is there a way to turn the document.referrer string into a Location like
object, so I can extrac the domain and other parts of it?

Posted: February 23rd, 2006

View 2 Replies!   View Related
Get The Referrer Of JS Popup?
I have some JS code that launches a popup (which is a PHP enabled page). It's the standard setup.

On that popup, I need to detect the referrer.

In PHP, $_SERVER['HTTP_REFERRER'] is not set, so I get nothing. As well, document.referrer is empty.

So how to detect the referrer?

Posted: November 21st, 2009, 04:02 PM

View 4 Replies!   View Related
Get Referrer URL After A Redirect?
If you enter an invalid video id in YouTube [URL] it will redirect you to a page saying it is a malformed video ID. Is there a way to get the original URL (in this example[URL] in javascript?(I'm talking about Javascript that will run on the browser after the redirect, through Firebug)

Posted: Nov 1 09 at 3:36

View 1 Replies!   View Related
Referrer In Frames
I have a site with the "standar" three frames (top, left, main) and in one of then i have a link that calls a Javascript function that at some point do

top.location.href = "Login.asp";

But this is sending the referrer the url of the frame where the code is, not the window url. How can i make the referrer the window url, not the frame url? From what i've serched Javascript can not change the referrer, is there any workaround?

Posted: Apr 20, 2005, 07:31

View 3 Replies!   View Related
HTTP Referrer Header
Is there a way to set the value of HTTP header Referrer to null or to
any specified value?? I have tried doing this

document.Referrer= null

but document.Referrer is a read only property therefore the value can't
be changed and a Javascript error is occuring. Any ideas on how this
can be achieved.

Posted: July 16th, 2006

View 1 Replies!   View Related
How To Get Top Referrer List On Homepage?
It certainly doesn't help that IE doesn't seem to pass document.referrer or am I missing something ? Is it set up thru an add-on analysis package? (referrer info from logs? )

Posted: July 20th, 2005

View 1 Replies!   View Related
Get The Referrer's Domain/host Name?
I know I can get the host name of the current page, by simply doing:

var myhostname = location.hostname;

But how do I get the host name of the referrer? I can get the referrer by

var referrer = document.referrer;

but unfortunately there's no document.referrer.hostname available in javascript. how I can get this value?

An example of where this is useful is if somebody clicks a link on [URL], I want to be able to retrieve [URL] from the referrer (not the page and the query string).

Posted: Aug 5 10 at 23:47

View 2 Replies!   View Related
Get Original Referrer Url When Invoking?
Let us take i am in site named "" and navigating to another site "", where i invoke a external js call.

The problem is the referrer of the js call is "" and but i need the original referrer i.e. "". I see that the google analytics request, i see that the query parameter utmr hold the referrer url. example - utmr [URL]

how to get the same as that in GA.

Posted: May 6 11 at 19:04

View 2 Replies!   View Related
Alternative To Referrer Object?
Is there an alternative to referrer object to check where user came from?history.previous doesn't seem to work.

Posted: Oct 13 11 at 14:11

View 1 Replies!   View Related
Find The Referrer URL's Title?
It should be possible because tracking softwares can find the referrer's title.

Posted: 03-21-2010, 09:33 PM

View 7 Replies!   View Related
Redirect On Specific Referrer Url?
I am looking for a javascript that will redirect if the visitor is coming from a certain specific. url.Basically I need the webpage to do a meta refresh or redirect to a new page if the visitor is coming from a specific url.

So if there was a link on this post to my webpage, it would redirect to google if the visitor came ftom this url,[URL]...

I have adwords coupons and can make a small paypal deposit for your time.

Posted: 03-26-2011, 08:07 AM

View 1 Replies!   View Related
Storing Referrer URL In Cookie?
I want to store several name value pairs in a single cookie on the client. One of those name value pairs is the document referrer. I am not sure what characters I can expect to find in the referrer, so I am not sure what delimiter to choose.Let's say I choose the tilde ~ character to delimit the name from the value, and the pipe | character to delimit the name value pairs. Then I might end up with a cookie like this:


Now let's say my referrer is http:[url].... then my cookie would now be:


I don't think I can rely on the tilde character being encoded as %7E in the referrer URL (or can I?) and therefore I would not be able to parse my cookie to get the component parts out.So my questions are:

(1) Is there a safe choice of character for my two delimiters?

(2) Could I rely on ~ and | always being encoded in the referrer?

Posted: Mar 8 11 at 11:48

View 2 Replies!   View Related
Hide Referrer On Click?
I want to hide the referrer when I click a link on my website. To understand better what I want to do: When somebody clicks a link on my website, I don't want the other website owner to know where the visitor came from.

I don't care if it's done by PHP, HTML or Javascript.

I tried with HTML refresh, javascript [url]..., javascript popup, PHP header redirect, but nothing worked.

Posted: Jun 21 11 at 16:29

View 5 Replies!   View Related
Saving URL Parameters From Referrer Link?
I am trying to save the URL parameters from a referrer link... For example I have the following link: and it takes you to a page where the javascript is running and saving the cookie: http:[URL] .Now i came out with the javascript code below but for some reason the parameter q is not saving in the cookie...

function gup( name )
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";


Posted: 17 May 2010

View 1 Replies!   View Related
Send A Location Hash Through A Referrer?
I have a page where in Javascript I add to the location hash something like: location.hash = "initial_source=previous_referrer".

Afterwards a window.location is done in order to redirect.

However the receiver gets the referrer in his request without the hash (#) part.

Is it possible to somehow modify the URL in the initial page, without a redirect, so the final referrer is what is desired?

Posted: Jan 11 10 at 0:39

View 2 Replies!   View Related
Jquery :: Changing The Referrer Of An Ajax POST?
Anyone knows if with jquery or general javascript, I can change the referrer from the header in an http ajax call?

basically I want it to be sent from my page but have a referrer from another page.

Posted: Nov 22 11 at 17:53

View 3 Replies!   View Related
Copyright 2005-08, All rights reserved