When we switch tabs, if we are using AJAX technology, we will encounter the following situation: Click the TAB1 option, the server sends an AJAX request to get the content data of this option TAB1. If the request is being processed and you click the TAB2 option in the process and send a new request, the server now has two requests pending. The result of the page is that when the data content is displayed, the content data for the TAB1 option is displayed first, and then the TAB2 option is displayed. In this case, we should cancel the TAB1 pending request, allowing only the processing of the current (TAB2) request to create a new index.html code as follows:
Copy CodeThe code is as follows:
Then create a 4.php file code as follows:
Copy CodeThe code is as follows:
Sleep (1);
if (Isset ($_get[' What '))
{
Switch ($_get[' what ')
{
Case 1:echo ' 111111111111111 ';
Break
Case 2:
Echo ' 22222222222222222 ';
Break
Case 3:
Echo ' 33333333333333333 ';
Break
Default:echo ' no content ';
}
}
?>
Also to build a folder JS,
Put a jquery-1.4.4.min.js file inside,
Not necessarily the 1.4.4 version;
Build a folder img,
Inside put a loading.gif wait picture will index.html + 4.php + JS (folder) +img (folder) put in the WWW file, run with the browser
http://www.bkjia.com/PHPjc/326729.html www.bkjia.com true http://www.bkjia.com/PHPjc/326729.html techarticle When we switch tabs, if we are using AJAX technology, we will encounter the following situation: Click the TAB1 option, the server sends an AJAX request to get the content data of this option TAB1. If ...