Directory (updated articles will be connected, and an article will be updated every two to three days starting from March 13, July 25 ):
ASP. NET + jquery. Ajax details 1-opening section (published on February 25)
ASP. NET + jquery. Ajax details 2-$. Load (published on 2012.07.26)
ASP. NET + jquery. Ajax details 3-$. Get and $. Post (published on February 30)
ASP. NET + jquery. Ajax details 4-$. getjson (published on February 31)
ASP. NET + jquery. Ajax details 5-$. getscript (2012.08.04)
ASP. NET + jquery. Ajax details 6-$. ajaxsetup (2012.08.06)
ASP. NET + jquery. Ajax details 7-Global Ajax events (published on 2012.08.09)
ASP. NET + jquery. Ajax details 8-core $. Ajax (published on February 12)
ASP. NET + jquery. Ajax details 9-serialize and serializearray (February 15)
ASP. NET + jquery. Ajax detailed description: 10-json and XML + are written at the end of the article (published on February 20 !)
Preface:
We learned a thing. We didn't have any idea about it at first, and we could just drag it in and find that water is getting deeper and deeper, and books are getting thicker and thicker. When we stick to it, just by drawing out and standing at a height and looking down on it, I found that this is actually the only thing that I learned is to understand five questions: What is it? What is the purpose? What is the relationship with others? What are the advantages of the same type? How to use it?
I write ASP. net + jquery. ajax is a series of articles, more specifically, to sort out these articles, focusing more on what it is and how to use it. On the one hand, it facilitates your own learning, and on the other hand, we hope to help you. As for what is the relationship with others, what are the advantages? The Internet is everywhere. If everyone thinks that something is good, you will think it is good for the moment and then learn about it. From this article, I think you can see why it is good.
I have already set up the framework of the series of articles. I have fixed the first draft and will revise the content. I will publish an article in about 2 or 3 days. The following is my OneNote document:
I still hope you have some JavaScript basics. For more information, see my article "go deep into JavaScript". This article will also be written.
Go to the topic !!!
------------
What Is Ajax?
Ajax = Asynchronous JavaScript and XML.
Ajax is a technology used to create fast dynamic web pages.
By performing a small amount of data exchange with the server in the background, AJAX can implement asynchronous updates on webpages. This means that you can update a part of a webpage without reloading the entire webpage.
If you need to update the content of a traditional web page (without Ajax), you must reload the entire web page.
There are many Ajax application cases: Sina Weibo, Google Maps, kaixin.com, and so on.
-------------- From w3cschool tutorial Network
In this case, Ajax makes our webpage more user-friendly and provides a better user experience.
Ajax is a required course for all web developers. Although Ajax technology is not complex, the implementation method varies with each developer. When our code is distributed everywhere to create a function for the XMLHTTPRequest object, write a judgment request, and write a callback function,
In addition, some Ajax programs have poor logic and structure. When it is difficult to understand, how can we unify these differences?
Now we need to use the jquery library.
Jquery is a Javascript script library. The Javascript script library is similar to a. Net class library. It encapsulates some methods in the class library,
Convenience for developers. among them, jquery provides a series of Ajax functions to help us unify some differences when using Ajax, in addition, it is cross-browser (you no longer need to make your scripts complex and ugly to adapt to all browsers), and makes calling Ajax easier and the code more concise and beautiful.
After comparison, we can see why we choose jquery. Ajax?
Use the original Ajax instance (vs2010 ):
Client:
<% @ Page Language = "C #" autoeventwireup = "true" codebehind = "oldajax. aspx. cs" inherits = "jqueryajaxtest. oldajax" %> <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
Server:
Using system; using system. collections. generic; using system. LINQ; using system. web; using system. web. ui; using system. web. UI. webcontrols; namespace jqueryajaxtest. data {public partial class getcity: system. web. UI. page {private string resulttype = "JSON"; protected void page_load (Object sender, eventargs e) {// obtain the request parameter if (! String. isnullorempty (request. querystring ["resulttype"]) {resulttype = request. querystring ["resulttype"]. tolower () = "html "? "Html": "JSON";} string html = getresult (resulttype); // clear the Buffer Response. clear (); // write the string to the response output stream response. write (HTML); // send the Current Buffer output to the client, and stop this page to execute response. end ();} private string getresult (string resulttype) {string result = ""; if (resulttype = "html ") {// returned HTML result = @ "<ul> <li id =" 1 ""> Beijing </LI> <li id = "2" "> Tianjin </ LI> </ul> ";} else if (resulttype = "JSON") {// returned JSON data result = @ "[{" "pkid" ":" "0001" "," "provinceid "": "" BJ "", "" cityname ":" "Beijing" "," "citynameen": "" Beijing "", "" postcode "": "" 010 "", "" ishotcity "": false}, {"" pkid "": "0002" "," "provinceid" ":" TJ "", "" cityname ":" "Tianjin" "," "citynameen" ":" "Tianjin" "," "postcode" ":" 022 "", "" ishotcity "": false}] ";}return result ;}}}
When using jquery. Ajax, we will talk about it later, and you will gradually understand why you should choose jquery. Ajax.
The general framework of this series of articles (Mind Map) is attached ):
I have limited capabilities. You are welcome to make a picture. You are also welcome to point out the shortcomings. We welcome criticism from the perspectives of writing, technology, and ideology.