Method 1:$ (function () { $.get ("URL", function (MSG) { $ ("where you want to display the hint"). HTML ("The data is loading: "); $ ("Where you want to display query data"). HTML (MSG); });
Method 2:
<title></title>
<body>
<input type= "button" value= "Test" onclick= "showimg ();"/>
<div id= "Div1" ></div>
<div id= "Div2" ></div>
</body>
<script type= "Text/javascript" >
function showimg () {
var div1 = document.getElementById ("Div1");
var div2 = document.getElementById ("Div2");
div1.innerhtml = " var T1 = setTimeout (function () {
var img = new Image ();
Img.onload = function () {
div1.innerhtml = "";
};
IMG.SRC = "Img/pdf.png";
Div2.appendchild (IMG);
}, 3000);
}
</script>
Method 3--Beforesend to set:
Simulate toast effects
The AJAX request server loads the data list when prompted loading ("load, please later ..."),
$.Ajax{Type:"POST",ContentType:"Application/json",Url:"/home/getlist",Beforesend:function(){$("Loading").Show ();},Success:function(Data{if (data=="Success"){// ...}},Complete:function ( Span class= "Hljs-params" >) {$ ( " Loading "). hide () }, error: function (data) { span class= "va" >console. info ( "error:" + data. ResponseText) }})
Tips for loading data during AJAX data loading