I have a code error popping up when someone hits the back button while an ajax call is loading. Is there a way to disable back until the call returns successfully?
Example:
$.ajax({
// Disable back button
url: "test.html",
context: document.body
}).done(function() {
// Enable back button
$(this).addClass("done");
});
I know it is bad to hijack browser functionality and I noted that but it's not my choice here i am not the project owner. Also it is just temporary for a few seconds while ajax does its thing. I have already searched but haven't come up with anything particularly useful for this scenario.