JavaScript method to get the current page source page (that is the previous page)

  • 2020-05-26 07:44:24
  • OfStack

This example shows how JavaScript gets the current page source page (that is, the previous page). Share with you for your reference. The details are as follows:

The JS code below gets the source page address through document.referrer


<!DOCTYPE html>
<html>
<body>
The referrer of this document is:
<script>
document.write(document.referrer);
</script>
</body>
</html>

I hope this article has been helpful to your javascript programming.


Related articles: