I’m working with AJAX and history object (with the .pushState method). I just want to know when is the right time to call pushState method? Is it before request? after request? or on what state of XMLHttpRequest’s readyState should I call it? As much as possible, I want it to behave like a normal request (without AJAX).
I’m working with AJAX and history object (with the .pushState method). I just want
Share
Only HTTP 200’s normally get added to a browsers history. So it probably makes sense to do
That way if your Ajax call has a 404 error for some reason it won’t be added to history just like in normal browsing.