I have a sharepoint site in which there is a javascript confirmation alert on which, on yes click, I'm showing a div which has the loading image via jquery and hiding it when the function is completed (it is a long running script). But on clicking yes, the page gets stuck for a long time and the loader image is not shown.
The code executes perfectly doing the job thereafter (I see stop script on IE and kill page on chrome sometimes).
The code for showing the div is:
var newdelAAEdate = new Date(new Date().setDate(new Date().getDate() + (-7)));
if (confirm('Are you sure you want to create AAE Timeslots for ' + $('#ddMonth option:selected').text() + ', ' + $('#ddYear option:selected').text() + '?\n\n Note: The time slots before ' + newdelAAEdate.toDateString() + ' will also be deleted.'))
{
$('#loaderDiv').show();
$("#outputWindow").css('background-color', 'white');
onClickAAE_Ts();
}
else
{
// Do nothing!
}
I finally hide the div when the function (which has GET, POST and DELETE rest calls running synchronously) gets executed, but none of it is happening.
Note: The div shows if I debug on chrome, but somehow skips normally