The example in this article describes the method of using JavaScript to obtain the source page of the current web page (ie, the previous page). Share it with everyone for your reference. The details are as follows:
The following JS code obtains 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 will be helpful to everyone’s JavaScript programming design.