With the development of web technology, Ria seems to have become the mainstream, and Ajax has become an indispensable part. Ajax is Asynchronous JavaScript and XML. Although many interactive data formats do not strictly adopt XML, This asynchronous
Ajax-server script [You can use Java, JSP,. net, and other server technologies to process the required results]
Now, we want to create a script that displays the current server time.
The responsetext attribute stores the data returned from the
Ajax suggest instance
In the following Ajax example, we will demonstrate how the webpage communicates with the Web server when a user inputs data to a standard HTML form.
Enter the name in the text box below:
Suggestions:No suggestion
Ajax is an essential web development technology for creating interactive web applications in project development. It includes multiple technologies:
1. XHTML + CSS2. Dom3. xml and XSLT4. XMLHttpRequest5. Use JavaScript to bind everything together
1. Different browsers
Create an XMLHTTPRequest object(General functions)
2. One
Simple AjaxProgramExample
User: Onkeyup= "Ajaxfunction ();" />
Time:
This is "time. Code : response. expires =-1 // The page is not cached.
AjaxAdvantages:
1Purpose: request data on demand to reduce the server bandwidth,
2, Without refreshing new requests, improvingWebPerformance, such as Form Verification:
1,JqueryOfAjaxOperation
JqueryEncapsulationAjaxOperation,
ArticleDirectory
Sample Code
Execution result
Server code
Sample Code
Execution result
Server code
Sample Code
Execution result
Server code
Code configured as the first method
Code configured as the second
The benefits of Ajax are Needless to say, such as asynchronous loading, partial refreshing, and user experience improvement.
A problem occurs when Ajax is used for data submission. After each submission, the last update prompt is always displayed.
After a request is sent, the client cannot determine when the request will be completed. Therefore, an event mechanism is required to capture the Request status. The XMLHTTPRequest object provides the onreadystatechange event to implement this
------------------------------ Webservice1.asmx ----------------------------------
// To allow ASP. Net ajax to call this web service from a script, cancel the comments to the downstream.
[System. Web. Script. Services. scriptservice]Public class
The result still does not work. The final solution is as follows:
1. Add async: false. That is, it is changed to synchronous. What does it mean? (According to my colleague, This is the webpage effect that will be executed only after Ajax has
Ajax asynchronously requests data and performs drop-down box Interaction
Bytes
Ajax code and JS Code:
VaR XMLHTTP;Function getdata (){// Obtain the province nameVaR provincename = $ ("# select1"). Val ();// Create an
Paging Homepage
pagination of martial arts novels
jquery implementation $. Ajax pagination id name author press ISBN number > type price
Paging PHP essential code
// Process data at the command model layer$ Link = mysql_connect ('
Ajax. net Professional
Microsoft. NET Framework 2.0
About ajax.net professional:
Ajax.net is a server framework for. NET platform Ajax.(Microsoft also has a framework called ATLAS. For details about Atlas, see dflying Chen's blog ),It allows you to
Document directory
Onreadystatechange attribute
Readystate attributes
Responsetext attributes
Ajax-learn more about XMLHttpRequest objects
Before sending data to the server, it is necessary to explain the three important attributes of the
In the previous article, javascript was used to implement simple Ajax technology. We can see that it is complicated to use javascript to implement ajax, because different browsers need to implement xmlHttpRequest in different ways. Since jQuery
1. first put Ajax. dll to add reference to the project, right-click on the project, there is a [add reference] on the menu, and then step by step that. after adding the DLL file, you will see the Ajax in the reference of the project. dll is
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