|
|
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".
|
|
|
| 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 |
|
|
|
|
|
|
|
|