I have a progress div which absolute positions across the top of the web page.
When I click on a Ajax.ActionLink, sometimes I see it flicker at the top when the request/response is just short of instant.
How can I add a delay so that the progress banner does not show for 500ms?
thank you
Here is the working code
var showProgress = false;
function AjaxBegin()
{
showProgress = true;
setTimeout("if (showProgress) { $('#progress').show(); }", 800);
}
function AjaxComplete()
{
showProgress = false;
$("#progress").hide();
}
function AjaxFailure(ajaxContext)
{
var response = ajaxContext.responseText;
alert("Error Code [" + ajaxContext.ErrorCode + "] " + response);
}
AjaxOptions
InsertionMode = InsertionMode.Replace;
OnFailure = "AjaxFailure";
OnBegin = "AjaxBegin";
OnComplete = "AjaxComplete";
HttpMethod = "GET";