I did it using unload event. This event will be called when a page is refreshed.
$(window).unload(function() {
var currentURL = window.location.href;
var index = currentURL.indexOf("?error=");
if(index > -1) {
window.location.href = currentURL.substring(0, index);
}
});
Then the page will be refreshed with the new URL.
Let me know if this will not work in any case.
Note: It doesnt work in chrome. How to make it work in chrome?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…