KnowlegeZone.com, Share knowledge Gain knowledge
New Articles:
     

Home > JavaScript : javascript history.previous is undefined

Question By: hornbill   Date: 8/27/2008

javascript history.previous is undefined

Am attempting to capture the previous url as a variable as follows:

            var ref = history.previous;

The output, however, is consistently: "undefined".



Share |


Comments.
Comment/Solution Posted By: adilkhan    Date: 8/27/2008 1:21:00 AM
sure you can, but you use following for the previous page.

var ref = document.referrer

Example:
<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

if (document.referrer&&document.referrer!="")
document.write('Thanks for visiting this site from '+document.referrer+'<BR>');

//-->
</script>

Comment/Solution Posted By: naveen    Date: 6/1/2010 7:47:00 AM
thanks it worked


Pages :
Post Comment or Solution   OR   Sign in using Google/Aol/Yahoo/Msn/OpenID
Your Name:  
Your Email:  
Comments:
 
Please Verify:
(Type Answer)