Delete browser history using jQuery

I have an ajax application based on jQuery. I have included browser history using the jQuery history plugin . But we find that the application generates too much history.

In particular, we provide a "ajax-back" button on the page, which allows the page to return to the previous ajax state. When the "ajax-back" button on the page was pressed, we want it to act as a browser back button, moving the current history index or deleting the last record history, instand inserting a new history record.

So, I would like to ask: can I delete the last browser entry from javascript? or is it possible to change the current index of the browser history list?

Examples based on the jQuery history plugin will be greatly appreciated.

+5
source share
2 answers

Most likely, you cannot easily do what you are trying. There is window.location.replace that jumps to the new URL and removes the current page from the story, but for full-page navigation, it will almost certainly break the jQuery way of falsifying the story.

, , window.history.go(), . , . back() forward(), go -1 1 . , , , , .

jQuery, , jQuery.history, onhashchange, . , , , .

+7

javascript ( / ). - , , jquery, .

+2

All Articles