please current url page called ? wrong ?, becaz alert comes empty.
<html> <head> <script> function check() { alert(document.referrer); } </script> </head> <body onload="check()"> </body> </html>
according mdn document.referrer
the value empty string if user navigated page directly (not through link, but, example, via bookmark).
you if want current page url can use
window.location.href
Comments
Post a Comment