I am using AJAX action after getting the response, I want to reload the current page, for which I am using:
window.location.reload();
It w
you can also try
window.location.href = window.location;
Try:
parent.window.location.reload();
This doesn't work in Firefox 17 for me.
The only other way I know that works in all browsers is to redirect to another blank page and redirect back to the current page.
Try this:
window.opener.location.reload(true);
window.self.close();
This works for me on all major browsers.
try the below:
window.location = self.location;
above code does not work for some browsers, you can even try:
location.reload( true );
Not sure why, but in my case i fixed it by wrapping the reload() call in a setTimeout with 100 ms.
setTimeout(function(){
window.location.reload();
},100);
If you are working with AJAX, you have to do the reload inside the success function.
$.ajax({
type: 'POST',
data: '',
url: '',
success: function(data){
setTimeout(function(){
window.location.reload();
},100);
},
error: function(){
}