X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM referrer Property

Document Object Reference Document Object

Example

Return the referrer of the current document:

var x = document.referrer;

The result of x will be:


Try it yourself »


Definition and Usage

The referrer property returns the URL of the document that loaded the current document.


Browser Support

Property
referrer Yes Yes Yes Yes Yes


Syntax

document.referrer

Technical Details

Return Value: A String, representing the URL of the document that loaded the current document. Returns the entire URL, including the protocol (like http://). If the current document was not opened through a link (for example, through a bookmark), an empty string is returned.
DOM Version Core Level 2 Document Object


Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook