AJAX "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML) is a technique used to create fast dynamic Web pages.
1.0 Advantages:1.1 improves the user experience through asynchronous mode.1.2 optimizes the transmission between the
Cors just can solve the problem.
Compared with JSONP, Cors is no doubt more advanced, convenient and reliable.
1. Jsonp can only implement get requests , while Cors supports all types of HTTP requests.
For example, if you need to obtain data from
Index.html
The code is as follows
Copy Code
)/ig; var srcre =/ssrc= ([' "]) (. *?) 1/i; var typere =/stype= ([' "]) (. *?) 1/i; Var match; While match = re.exec (html)) { var attrs = match[1]; var srcmatch =
Often used to jquery+ajax/"target=" _blank >jquery Ajax, but sometimes forget how to write, take a note below. jquery Ajax Example:
The code is as follows
Copy Code
Post method $.ajax ({ URL: ' test.php ', Type: ' Post ',
Let's look at the demo code first.
The code is as follows
Copy Code
"http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "" ajax json test ajax uses JSON for front and back interaction Get all user
First know to Jquery.post (URL, [data], [callback], [type])
Describe the parameters:
URL: Sends the request address.
Data: Key/value parameter to be sent.
Callback: callback function when sending success.
Type: Returns the content format, XML,
Automatic refresh of the Web site has been a common occurrence, such as real-time news information, stock information, etc., need to constantly get the latest information. In the traditional way of web implementation, want to achieve similar effect,
Learning Ajax recently, I stumbled upon a series of articles on IBM's Developerworks, "Mastering Ajax" is very good, not only explained the principles of Ajax, but also on the web of XML, server-related, DOM processing, and so on the principles of a
JS Original Ecological Writing
The code is as follows
Copy Code
var mm;var nn;function MakeRequest (url,obj,b) {Mm=obj;Nn=b;Http_request = false;if (window. XMLHttpRequest) {Http_request = new XMLHttpRequest ();if
Ajax Implementation Login Verification
JS files are as follows:
var xmlHttp;
function Img1_onclick () {
Checkisvalid ();
}
function Checkisvalid ()
{
Creatxmlhttprequest ();
var Username=document.getelementbyid ("Admintext");
var
-ajaxA. Full name: Asynchronous JavaScript and XML (asynchronous JavaScript and XML)B. Meaning: A Web development technology for creating interactive Web applicationsC. function: To achieve local refresh, reduce server pressureD. Principle of work:
Solution of error in Response.Write output JS script in Ajax
Ajax 3.5 is not altered. Later tried to Scriptmanager.registerstartupscript (UpdatePanel1, typeof (UpdatePanel), "AAA", ", True); The last true in is changed to
In JQuery 1.2, you can load JSON data for other domains, such as "myurl?callback=?", by using a callback function in JSONP form. Will jQuery be replaced automatically? To the correct function name to execute the callback function. Note: The code
。 The series API knows that the IE10 preview is not yet supported, and the latest version of Firefox/safari/chrome/opera supports
0
0
Development should be based on the requirements of the combination of the above forms
Create an available Xmlhttpreuqest object
XML document Data
A simple ASP output XML example, Later in our Ajax tutorial example, we will use this file for data read operations html css Tutorials dom javascript
Author: driseAsp:Response. ContentType = "text/html"Response. Charset = "GB2312"Php:Header ("Content-type: text/html; charset = gb2312 ");//Other methods are similar.As long as you set the encoding based on your own page, there is generally no
Baidu and Google seem to have been doing this for many years. I thought it was easy to find code on the Internet to achieve this effect. We can't find this requirement. Therefore, I wrote this result by myself. Because I integrated the effect into
Load syntax$ (". Selector"). load ("url", function (responseText, statusText, xmlhttprequest ));When loading a page, if an error occurs, the corresponding prompt is displayed based on the status given by statusText, which is very important to the
Commonly used ajac in jquery includes $. ajax (), $. post, $. get (), $. load.Example The code is as follows:Copy code $. Post ("test. jsp ",{Name: "cssrain", time: "2008/01/21"}, // data to be transmittedFunction (data ){Alert ("returned data:"
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