I have page A and B. in my page A, I have link that direct me to page B. What I want to do is, when I click the link in page A, it will open page B, and also give me alert of page A`s URL. Here is what I try:
page A:
<html>
<head>
<a href="file:///C:/Users/jason/Desktop/pageb.html">click me</a>
</head>
</html>
page B:
<html>
<head>
<script type="text/javascript">
var oldURL = document.referrer;
alert(oldURL);
</script>
</head>
It opens the page B when I click it, but the alert is blank. How can i do this?