Home>

Ajax loading background data is not as detailed.

Look at the following code first place the code on the foreground

<div>
<img src="../../images/loading1.gif" />
</div>

First hide this picture animation in the js script file

code show as below

$(document) .ready (function () {$("#loadgif"). hide ();});

Then the asynchronous ajax submit request code is as follows

$(function () {
var find=new find ();
//alert(find.template);
$.ajaxsetup ({
cache:false,async:true,global:false,type:"post"
});
$("#querybtn"). click (function () {$("#loadgif"). show ();find.get ()});

.....................

note:

async:true,

Call animation when click querybtn button

$("#loadgif"). show ();

Then submit the request

After receiving the request

$("#loadgif"). hide ();

The effect is as follows:

  • Previous 3 ways to implement paging in php
  • Next JS method to get the keys pressed by the keyboard and display them on the page