Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
loading gif image on ajaxStart and ajaxStop function for showing and hiding


XML
var loading = $(' <div id="loading">  <img src="../img/loading%20(1).gif" id="loading-image" alt="Loading..." /> </div>');

$(document).ajaxStart(function () {
    $( ".your-div-class" ).append( loading );
});

$(document).ajaxStop(function () {
    $( "#loading" ).remove();
});
Posted
Updated 18-Nov-14 18:12pm
v2
Comments
AnvilRanger 18-Nov-14 10:09am    
Where are you stuck? What have you tried? The more details and effort you put into asking your question the better chance someone will answer.

Review the following link about posting here in the QA.
http://www.codeproject.com/Articles/64628/Code-Project-Quick-Answers-FAQ#rules

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900