Using jquery for easy access to Ajax asynchronous data, the following example is an AJAX feature similar to the type user name
jquery.post (URL, [data], [callback], [type]): asynchronous request using POST method
Parameters:
URL (String): The URL
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 =
The following code implementation AJAX is submitting effect: Loading ....
Onchange= "Selecte (this.options[this.options.selectedindex].value)" >
Please select
CssRain1
CssRain2
CssRain3
CssRain4
You chose Region 2.
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
Ajax frameworks are a collection of modular Ajax capabilities that can be implemented in a variety of languages (such as Sajax with a variety of language implementations), and Ajax is just one part of jquery,
Instance 1
The code is as
Ajax-Level Linkage menu code
Big class 1 Big class 2
Header ("CONTENT-TYPE:TEXT/HTML;CHARSET=GBK")//output encoding to avoid Chinese garbled$pid =$_get[' pid '];
$db =mysql_connect ("localhost", "root", "7529639"); Creating a database
For Ajax, the core object is XMLHttpRequest, all AJAX operations are inseparable from the operation of this object.Creating XMLHttpRequest ObjectsFor IE browsers:
The code is as follows
Copy Code
XmlHttp = new
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
jquery Ajax No Refresh data submission instance
name "this field is required.
return emailthis field is required.
return phone"this field is required.
You may notice that I have included an ID contact_form the div around the entire form of
How AJAX thumb ups are implementedYou can use custom fields to save the number of likes, and use cookies to disable repeated likes.WordPress does not use plug-ins to implement the AJAX thumb up processWe directly add the following code to your
I have written many articles about JQueryElement. There are many Ajax calls in the JQueryElement control. To facilitate your understanding, I wrote this article to explain how the Parameter object adds parameters for Ajax.Sample Code Download: http:/
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
A general ajax event may have already written a success during the development process. In subsequent development, I may not want to change the success method I wrote earlier. I want to restart a success, for example, the following code: The code
Example 1 The code is as follows:Copy code $. Ajax ({ Type: "POST ",Url: "/a. php ",Success: function (result ){// ToDo:} ) When we click submit, no results are returned, so no results are found in the test using the ff browser. Later, we found
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