Greetings to friends, I want to show the Ajax loader before loading data in a particular div, but the problem is that the data arrives dynamically on one page, but my script calls data from another file, Script.phpsee my code below
Script
<script>
function loadingAjax(div_id)
{
$("#"+div_id).html('<img src="ajax-loader.gif"> saving...');
$.ajax({
type: "POST",
url: "script.php",
data: "name=John&id=28",
success: function(msg){
$("#"+div_id).html(msg);
}
});
}
</script>
HTML
<body onload="loadingAjax('myDiv');">
<div id="myDiv"></div>
<div id="xyz"><img src="ss/image/abc.jpg" /></div>
</body>
It works fine, but I want to upload data on one page, please help me
Thanks in advance....
EDIT
I want to show the bootloader before loading data #xyzinto#myDiv
source
share