I borrowed a phrase from Brother plum blossom: fast and furious.
First of all, let's compare the ajax.net and Atlas! So that friends may not make the same mistakes as me in some aspects. Of course, this only represents my experience and my point of
I will not blow off the ease of server operations. Everyone on the Earth knows that it is the most annoying thing to do is page refresh, and his head is dizzy, and when he is refreshing, also trigger server-side events (solution:
I. Ajax process event analysis
Jquery triggers many events during Ajax execution.These events can be divided into two types: local and global ).Partial event: it can be called through $. Ajax. If an Ajax request does not want to generate a global
Some simple
Code Simplified
The following is a simple example to illustrate the impact of jquery on code. To execute some really simple and common tasks, for example, attaching a click event to each link in a certain area of the page, you can
Symptoms:
1) In Firefox, the processing page is encoded as gb2312, and data submission is correct;
2) In IE8, the processing page is encoded as gb2312, and garbled characters occur when submitting Chinese data.
Whether it is $. post or $. ajax,
CopyCode The Code is as follows: // create an xhr object
VaR xhr;
If (window. XMLHttpRequest ){
Xhr = new XMLHttpRequest ();
}
Else if (window. activexobject ){
Xhr = new activexobject ("msxml2.xmlhttp ");
}
Else {
Throw new error ("Ajax is not
This article is intended to be reprinted, but it is basically useless and cannot help anyone! So let's get started !!
I usually don't use it as a classic or I don't need to repost it on my own, so if you see it unfortunately, if you are interested
AJAX obtains the current server time
------------------------------ WebService1.asmx ----------------------------------
Copy codeThe Code is as follows: // to allow ASP. net ajax to call this Web service from a script, cancel the comments to the
When someone else writes JavaScript code, add random parameters to the ajax request address, such as XXXX? T = + new Date (). getTime ().
At first, I couldn't understand why. I checked the information on the Internet because it prevented browser
Copy codeThe Code is as follows: // download an Ajax File
JQuery. download = function (url, data, method ){
// Obtain url and data
If (url & data ){
// Data is string or array/object
Data = typeof data = 'string '? Data: jQuery. param (data );
Copy codeThe Code is as follows: $. ajax ({
DataType: 'json', type: 'post', url: 'http: // localhost/test. do ', data: {id: 1, type: 'item'}, success: function (data ){}});
Problem: When the background action program is submitted, the type obtained
Aspx
Copy codeThe Code is as follows:
Border = "0">
announcement:
Background Util/MainUtil. aspx. cs outputs the corresponding HTML data
Using System;
Using System. Collections;
Using System.
Copy codeThe Code is as follows: Easy. Ajax = {
ProxyPool :{
Length: function (){
Var I = 0;
For (var p in this)
I ++;
Return I-1;
}
},
Index: 0,
Async: true,
XmlData: false,
Timeout: 1,
DefaultHeader: 'application/json; charset = UTF-8 ',
Revoke
If you have mastered the previous articles. ajax deletion is easy to implement. what I want to teach you is. use JavaScript and Dom flexibly to achieve a cool Delete effect. you actually learned this. it is clear that in ajax technology, the
Preface:When jquery ajax is encoded in UTF-8 (page UTF-8, receives UTF-8), there is no problem. You can post and get the correct content directly on the processing page.
However, in the following cases:
GBK-> ajax post-> GBK
UTF-8-> ajax post->
Create an xmlhttprequest object.
Copy codeThe Code is as follows: return window. ActiveXObject? New window. ActiveXObject ('Microsoft. xmlhttp'): new XMLHttpRequest;
The next object is an onreadystatechange event. There are two attributes:
The final result is a directory File Viewer ,:
The principle is that when you click a directory, the path of the directory is sent to the server, and the server returns the file and directory information in the directory. On the server side,
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