In web design, the use of Ajax technology is already very common, especially in the interactive web site, Ajax technology is even more indispensable, almost all interactive Web applications, will see Ajax technology, large sites such as membership
JavaScript is a scripting language that executes on the browser side, and Ajax is a development technique for creating interactive Web applications that leverages a range of related technologies including JavaScript.
JavaScript is a scripting
Instance code:
Encapsulated AJAX Network Request function//obj is an object function AJAX (obj) {//Cross-domain request if (Obj.datatype = "Jsonp") {//here callback must be It's a global variable. The variable cannot be destroyed//processed
Return to the original JS, the Internet to see the AJAX package, then take to change, I do not know what the drawbacks, I hope to point out!
var ajaxhelper = {/*1.0 browser-compatible way to create asynchronous object/Makexhr:function ()
Ajax transfer JSON format data, the key is to specify Contenttype,data if JSON format
If the restful interface, change the type to the corresponding post (add), delete (delete), put (change), get (check) can
var post_data={"name": "test001",
Introduction to Ajax
AJAX = Asynchronous JavaScript and XML (asynchronous JavaScript and XML).
AJAX is not a new programming language, but a new way of using existing standards.
AJAX is the art of exchanging data with the server and updating
Introduction to Ajax
Ajax, "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), refers to a web development technology that creates interactive Web applications.
AJAX = Asynchronous JavaScript and XML (a subset of standard generic
Problems with Get encountered:
1. Question one. Caching: When each access URL is the same, the client directly reads the contents of the local cache, even if the background data changes the foreground will not change;
Solution: In? The following
Http://www.dragonson.com/doc/ajax.htmlAjax Internal Communication Documentation
Http://info96.k12studio.com/~nio/comments.php?id=242_0_1_0_CSimple description of Ajax
http://www.adaptivepath.com/publications/essays/archives/000385.phpajax:a New
First, the main reason to use Ajax
1, through the appropriate AJAX application to achieve a better user experience;
2, some of the previous server burden to the client, to facilitate the client idle processing capacity to deal with, reduce the
1. Native Ajax
difference between get request and POST request: yellow small triangle
Take the GET request as an example, the output is as follows:
Ajax in the 2.jquery
The 6 commonly used methods are listed:
3. Status Description
I think the Ajax object in Prototype.js must have attracted a lot of people, and a lot of the classes that encapsulate the Ajax logic are a great help to us beginners using AJAX.
Here is a specific example of my use to explain: effect look here
1.
First look at the calling mode:
Copy Code code as follows:
Ajax.request ("ajax.html", {v:math.random (), num:1},function (data) {
Do something
}, ' get ');
Way like jquery oh ... Still think this kind of call
First Drop-down Box:
Copy Code code as follows:
The value in the first Drop-down box
The second Drop-down box:
Copy Code code as follows:
/ To 3 and the menu can also be written at the appropriate time
Reasons that cannot be invoked outside Ajax internal values and how to solve them
var id= ' 123 ';
$.ajax ({
URL: ' Http://www.xxx.com/ajax ',
type: ' Post ',
dataType: ' json ',
data:{wurl:w_url,murl:m_
In struts application, we send out the request will be related to the relevant interceptor processing, generally there will be a user login interception (session failure interception); General requests, if the session fails, we will jump to the
In web development we often need to implement a timed refresh of a page:
1. To keep the value of the session or to check whether the session value is empty (for example, to prevent the same user from repeatedly logging in);
2. Realize the
The HTML5 AJAX 2.0 standard enhances many features of Ajax, including sending Formdata data, uploading data progress bars, and more. In practice, however, Ajax can send binary data in bytes.
Send binary data
var oreq = new XMLHttpRequest ();
The example of this article introduced the AJAX authentication username and password of the specific code for your reference, the specific contents are as follows
1.ajax Body part
var xmlrequest; function Createxmlhttprequest () {if (window).
This example for you to share the Ajax transfer of multiple parameters of the specific code for your reference, the specific contents are as follows
user name password
Webservice1.asmx
Using System;
Using
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