In the browser, an asynchronous Ajax request originated in the background, the server in response, with the cookie information, then next to the same domain name under the other page request, the cookie is valid, will be submitted to the Web server
Jquery.get (URL, [data], [callback]): Asynchronous request using Get method
This is a simple GET request function to replace the complex $.ajax. Callback functions can be invoked when the request succeeds. If you need to perform a function when an
Submit a Form $get way
The Get () method loads information through a remote HTTP GET request
Format
$ (selector). Get (Url,data,success (RESPONSE,STATUS,XHR), DataType)
Request test.php Web page, transfer 2 parameters, ignore return value:
$.post (Url,[data],[callback],[type])
Description: This function is similar to the $.get () parameter, more than a type parameter, type is the requested data type, can be html,xml,json and other types, if we set this parameter to: JSON, then the
jquery Ajax loading XML documents
Method Two
Many times the inability to parse is the content-type problem. If you are an XML file, skip this step.Dynamically generated XML must be set to Text/xml, otherwise the default is
jquery Ajax Application Instance code/*Ajax sends data to a page$.post (' save.cgi ', {Text: ' My string ',Number:23}, function () {Alert (' Your data has been saved. ');});
If you do need to write some complex Ajax scripts, you need to use the
UpdatePanel
a very important control in Atlas, powerful and easy to use, allows us to add Ajax to an existing ASP.net site with little change. With the advice of dflying, I am also a world of UpdatePanel into Atlas. This article will add UpdatePanel
The solution of Ajax Chinese garbled, in fact, will be in the server side of the file plus a header, indicating what the code stream is sent. Like what
An ASP document adds a single line to the header description:
The code is as
A UTF8 page requires post data to the GB2312 page, when the Chinese encoding is submitted in accordance with the UTF8, GB2312 the page can not receive. How to achieve, the network search a very good way, but there is a flaw, here one.
1, the form
Ajax has two ways of submitting data, get and post, respectively. The Post method can transmit data larger than 2K, and the application in Ajax differs in that the "POST method's request address and the transmitted data are placed in two
Using Ajaxmethod can asynchronously invoke the server-side method in the client, simply call the background in JS. cs file in the method, do some JS can not do the operation, such as query the database. Use Ajaxmethod to satisfy a few points:
1. If
A comparison of Xajax and other Ajax frameworksXajax function is very simple, but very flexible! ~ It's not like some other big frame, the function is really powerful, but the execution speed is not flattering. Although many functions, but not
Briefly describe the advantages and disadvantages of Ajax, and briefly describe the advantages and disadvantages of Ajax
Advantages of ajax
The benefits brought to us by Ajax are basically profound experiences. Here I will only briefly talk about
Based on Ajax form submission and simple background processing applications, ajax form submission background
First, let's start with form submission. To submit a form, we need to collect the form data first (as for verification, I will not talk
With jquery, ajax has become quite simple.However, for simplicity, you may not need to load a huge js plug-in such as jquery in the project.But what should I do if I want to use ajax?Before implementing ajax, you must create an XMLHttpRequest object.
Click "change" to randomly change the content.Because there are "standard", "image", "video" and other article forms, here we need to randomly obtain an article in the form of images, and take out the pictures, and links, use ajax to replace the
The code is as follows:Copy code Http://www.w3.org/tr/rec-html140/strict.dtd> ajax user registration demo ajax user registration program * user account: * user password: * Confirm password: * email: Reg.
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