For example, if an user is on http://example.com, then the user goes to http://example.com#comments. If the user clicks “back” on his browser, how can I make him “ignore” http://example.com and go directly to the URL that he visited before that?
I have jQuery loaded.
Instead of having a link like:
Use
location.replace()to “overwrite” the record ofhttp://example.comin the browser’s history.https://developer.mozilla.org/en/DOM/window.location
Example:
HTML:
JavaScript: