When $. Ajax () is used, I set the timeout time to 3 seconds:
CopyCodeThe Code is as follows: $. Ajax ({
URL: "ajaxtable1.aspx ",
Cache: false,
Error: function (XMLHttpRequest, textstatus, errorthrown ){
//
},
Success: function (HTML ){
//
}
Basic usage:
CopyCode The Code is as follows: var Ajax = new ajaxobj (URL );
Ajax. addlistener (200, function (r ){
Alert (R );
});
Ajax. Send ();
It can also be called consecutively: Copy codeThe Code is as follows: var Ajax = new ajaxobj (URL).
CopyCode The Code is as follows :/**
* pagination. js
* General Ajax-based paging class
* @ Author jeanwendy
* @ Version 1.0
*/
VaR paginationindex = 0;
VaR pagination = function (trtemplatid ){
$ (). Ajaxstart (function (){
$. Blockui ({
Message:
First, let's list the implementation of Ajax in jquery and prototype.
Jquery:
CopyCode The Code is as follows:
Prototype:Copy codeThe Code is as follows:
the prototype cannot be refreshed after the setinterval function is introduced. Why?
The load () method is the simplest and most commonly used Ajax method in jquery. It can load remote htmlCodeAnd insert it to the Dom. Its syntax structure is:
Load (URL [, data] [, callback])
The parameters of the load () method are described in
Use $. Ajax in jqueryThen, when the Ajax attribute is specified, 'false' is used '.
The hateful JavaScript feature is shown here.
In jquery, most of the time, attributes are caused.Otherwise, it is easy to become a variable name. For example, Red.
• Multiple ajax requests are sent at the same time and independent from each other.
• Multiple ajax requests are mutually dependent and must be sequenced.
• Multiple requests are sent at the same time. Only the last request is required.
1st
Obviously, AJax is a technology that uses JavaScript scripts to access data.
AJAX enables asynchronous update of web pages. This means that the webpage is partially updated without reloading the entire webpage.
XMLHttpRequest is the key to AJAX
Ajax. js
------------------------- [Ajax class] --------------------------
Copy codeThe Code is as follows: function Ajax (recvType ){
Var aj = new Object ();
Aj. recvType = recvType? RecvType. toUpperCase (): 'html'; // file type passed to the
Unlike other ajax frameworks, PHPRPC follows the principle of "only do one thing and do it well. It is only responsible for data transmission, and will be the best transmission! It makes it easy for you to do things that were previously impossible
Abstract:
Ajax Learning 1 describes how to use ajax encapsulated by jquery to receive text data from the server and XMLHttpReques object to receive text data from the server.
Ajax 2 describes how to use XMLHttpReques to receive XML data from the
Abstract: In this section, add ajax Study Notes 1.
Method 2: Use the responseXML method of the XMLHttpRequest object to accept the DOM object of the XML data object.
In the ajax study Note 1, you have made a detailed introduction to the preparation
Unfortunately, this is not the case with a legacy system I have used. Therefore, the call method is transformed by applying the ajaxPrefilter of jQuery on the client.
Copy codeThe Code is as follows:
ajaxPrefilter demo
Use comparisonCopy
You can use it by adding a reference Dll file. /201101/tools/newtonsoft.json.netw.rar
In the jquery library, getJSON is actually called: Query. get (url, data, callback, "json ")
The parameter is also in the k/v format. The returned request is
Google AJAX search APIDocument: http://code.google.com/intl/zh-CN/apis/websearch/docs/
Copy codeThe Code is as follows:
Google AJAX search API
Loading...
Index.html
Copy codeThe Code is as follows:
jQuery Ajax instance demonstration
input name:
enter the password:
ajax submit
post submission
get submit
Login. phpCopy codeThe Code is as follows: Echo json_encode (array
XMLHttpRequest provides the protocol for communication between the client and the http server.
I. Create
IE: http_request = new ActiveXObject ("Msxml2.XMLHTTP ");
Http_request = new ActiveXObject ("Microsoft. XMLHTTP ");
Non-IE: http_request = new
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service