Skip to content

Instantly share code, notes, and snippets.

@jinan-kordab
Created November 11, 2018 13:49
Show Gist options
  • Save jinan-kordab/cd17d73ee97523882c87d9746e80936e to your computer and use it in GitHub Desktop.
Save jinan-kordab/cd17d73ee97523882c87d9746e80936e to your computer and use it in GitHub Desktop.
Function to call once we submit a form, show, hide spinner
$("#downloadForm").on("submit", function (event) {
/////////////show spiner////////////////
myGlobalToken = new Date().getTime(); //JavaScript time token
$('#spinnerToken').val(myGlobalToken); // set the hidden input our token value
var ua = window.navigator.userAgent;
var is_ie = /MSIE|Trident/.test(ua);
if (is_ie) {
//IE
$(".animatedSpinnerContainer").html("<img src=\"../../Images/spinner.gif\" />");
}
else {
$(".animatedSpinnerContainer").show();
}
//Check if the Session spinner token has been set, to compare it later
// on and hide the spinner if the condition is met
checkSessionState();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment