You can identify the source webpage using the document.referrer command. The document object is the page currently loaded in the browser window – presumably your Web page. The referrer property is the page the visitor was at immediately prior to visiting the current page. You can code it as,
functionIdentifySourceWebPage()
{
if(document.referrer != ’’)
document.write(’You came from ’ + document.referrer);
}
Share with