The maximum value of window.history.length

The value of window.history.length very important in our project in order to detect that feedback is clicked on the browser. However, I realized that window.history.length does not pass 50. How to solve this? Thank you for your help.

+4
javascript
May 03 '13 at 9:23
source share
2 answers

With iFrames, you can find "Back Button Clicked". You can find the answer here .

+1
May 17 '13 at 7:27
source share

Depending on whether you need to be constant in sessions and survive in the purity of user information (cache, localStorage, etc.), you can make various decisions.

One solution might be to do something like this:

 window.onpopstate = function(event) { var count = parseInt(localStorage.getItem('history-changes-count'), 10); localStorage.setItem('history-changes-count', ++count); }; 

Please note that onpopstate is called only after the user action, it does not work if you change the history programmatically.

More on the topic: https://developer.mozilla.org/en-US/docs/DOM/window.onpopstate

+6
May 3 '13 at 12:14
source share



All Articles