I currently have a issue with firefox, where all other browser behave in the right way - even IE6!
What I want to do is redirection to a subpage but leaving a history entry. There are 2 methods of rewriting the url as far as I know:
So I have to use the first one and tested in the firebug console everthing works fine.
Now there is the kind of strange part of this question: the same statement, that worked fine in the console doesn't in some jQuery callback handler:
jQuery("#selector").bind("submit", function() {
$.getJSON("some_cool_json", function(response) {
var redirect_path = response.path;
window.location = redirect_path;
});
return false;
});
where response_path
is set correctly, I checked it! Even the redirection is working correctly, but there is no history entry created.
Any ideas on that one? Would be great! ;)
Cheers
Joe
use assign():
window.location.assign("http://...");
replace(url)
Replace the current document with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With