I have created functionality using jQuery, so when user click on button it will make clear filter on that page and reload page.
While clearing filter loader is showing on page, but when reload page line come then that loader is getting hide and page is reloading.
What I want is loader must displayed when page getting reload.
Below is some code.
var finalURLStrings = urlFinal.replace("isInboxstring=True", "isInboxstring=False");
var finalURLString = finalURLStrings.replace("isInbox=True", "isInbox=False");
$("#loading").show();
window.location.href = finalURLString; // while executing this line I still want to show loader which get hide here.
The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page and New page always reload and loading any spinner not show in new page.
so use this code below code:
$("#loading").show();
$(document).ready(function () {
$("#loading").hide();
});