How does JS return to the previous page with intra-page navigation?

the reader I made has a directory made of a tag.
history.back (); returns to the location of the a tag that was positioned last time, rather than to the previous page.
how to return to the previous page with intra-page a tag navigation?

is either a fixed url, or returns the last accessed file. For example, a user enters page B from an unknown A page, visits B-sharptitle and BMel sharpcontent in page B, and now wants to click the button to return to An instead of B-sharptitle.

I thought that every time I clicked on the a tag, I counted + 1, and finally hisotry.go (- num),), but it felt so troublesome that every a tag had to write an onclick. Is there a simpler way?

Aug.18,2021

directly

window.location.href = document.referrer

does this meet the requirements?


as , so that the previous url of this page will not be recorded in history, and then use history.back (); to return to the previous interface

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bbfd-2c2a3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bbfd-2c2a3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?