I have a progress div that contains absolute positions at the top of the webpage.
When I click on Ajax.ActionLink, sometimes I see that it flickers at the top when the request / response ends instantly.
How to add a delay so that the progress banner does not appear for 500 ms?
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";
source share