I have a div that should appear when saving. The markup for this is similar to this:
<div class="Working" style="display: none;">Message</div>
Later in my code I have some save logic, which does this:
function SaveData() {
var cancelSave = false;
$('.Working').text('Saving data ...').show();
var saveData = { 'Data': myData }; // Actually a lot of logic in here
if (cancelSave) {
$('.Working').hide();
} else {
$.ajax({
// bunch of stuff here
async: false, // tried this both ways
error: function (rsp) {
$('.Working').hide();
},
success: function (rsp) {
$('.Working').text('Saved');
$('.Working').fadeOut(5000, DoNothing());
}
});
}
}
function DoNothing() {
// Does nothing
}
If I step through the code, the div shows up perfectly when I step through the initial .show() line. However, when I run this at "full speed" ... I never see the "Saving data ..." message. The actual save does take about 5-7 seconds, so there is plenty of time to see the message.