Modification at night
Code, Previously used
Copy codeThe Code is as follows: $. Ajax ({
..
Datatype: 'json ',
...
Success: function (JSON ){
// Disable success
},
Error: function (error ){
// Always execute this error
}
});
Why? After
I recently encountered the problem of passing Chinese parameters. Search online, copy, paste, and publish the "ultimate" solution "is nothing more than escape (STR) for transcoding, and then write a method on the server to edit it again, or use
1. Chrome style jquery image gallery
A jquery plug-in for implementing beautiful chrome image galleries for Online demonstration
2. Awkward Showcase
This plug-in can be used to display slides of various content, such as text, images, videos,
The property method can contain parameters:
CopyCode The Code is as follows: function classx (name ){
This. Name = Name;
Classx. Prototype. Show = function (PARAM ){
Alert (this. Name + "" + PARAM );
};
}
VaR o = new classx ("name ");
O. Show
I. ajaxsample. aspx
Process business data and generate XML data for jqueryrequest. aspx to call,CodeAs follows:Copy codeThe Code is as follows: protected void page_load (Object sender, eventargs E){String uid = request. querystring ["username"]
Abstract:
Ajax Learning 1 describes how to use ajax encapsulated by jquery to receive text data from the server and XMLHttpReques object to receive text data from the server.
Ajax 2 describes how to use XMLHttpReques to receive XML data from the
Abstract: In this section, add ajax Study Notes 1.
Method 2: Use the responseXML method of the XMLHttpRequest object to accept the DOM object of the XML data object.
In the ajax study Note 1, you have made a detailed introduction to the preparation
AJAX introduction:AJAX refers to Asynchronous JavaScript And XML (Asynchronous JavaScript And XML), And is a web development technology used to create interactive web applications. Through AJAX, JavaScript can use the XMLHttpRequest object of
Let's start with some basic knowledge:
Syntax: $. ajax ({option })
Option indicates the parameter. In the form of key/value.
Common parameters: type: post/get.
Url: the address where the request is sent.
Data: {object: object} the data sent to the
I. Use iframe to generate history through document. write
Copy codeThe Code is as follows:
0
0
Click the button to update the page DOM (simulate ajax submission). the browser's back button is available. Click Back to return to the
I. js script cache Problems
A: This is one of the most common problems you have encountered, because when you modify the js content for debuggingThe result of the newly written code cannot be displayed because the current page uses cache
Unfortunately, this is not the case with a legacy system I have used. Therefore, the call method is transformed by applying the ajaxPrefilter of jQuery on the client.
Copy codeThe Code is as follows:
ajaxPrefilter demo
Use comparisonCopy
Functions:
If the user name is blank, the system prompts "the user name cannot be blank"
If the user name prompts "user name [xxxxxx] already exists, use another user name, 4"
If the user name does not exist, the message "user name [xxxxxx] does not
$. Get () and $. post () methods are basically the same, so only $. post () is used!
Scenario 1: $. post ("url", function); The returned data is not processed, so it is not in json format!
Scenario 2: $. post ("url", function, "json"); although
With this example, we hope that the content of example.html will be retrieved using the method of ajax, and then the div of the page id = callbackdemo3 will be dynamically updated.
The HTML is as follows:
Copy codeThe Code is as follows:
ajax load1
Cross-origin operations of Ajax have always been a problem. Currently, the main solutions include:
1. JSONP (must be supported on the server)
2. IFrame (operations can only be performed between subdomains)
3. Page proxy (this is omnipotent)
4.
1. WebService. asmx
Process business data and generate weather data in the GetWhether Method for JqueryRequest. aspx to call. The Code is as follows:
Copy codeThe Code is as follows: [System. Web. Script. Services. ScriptService]
Public class
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