The full format of the Load method is: Load (URL, [data], [callback]),
which
URL: Refers to the address of the file to be imported.data: Optional parameters; Because load can not only import static HTML files, but also import dynamic scripts, such
$pinyins = Array ();When the phonetic ishead=0 of a string of Chinese characters is obtained, the output pinyin first letter when outputting the whole phonetic ishead=1function Getpinyin ($str, $ishead =0, $isclose =1) {Global $pinyins;$restr =
Jquery.post (URL, [data], [callback], [type])
Load information through a remote HTTP POST request and use Post to make asynchronous requests.
This is a simple POST request function to replace the complex $.ajax. Callback functions can be invoked
This article provides the tutorial is a JS Ajax solution browser "forward" "Back" button invalidation problem oh, in AJAX development, the forward back page is a difficult problem, now we provide a complete solution to deal with this matter.
new
Below through the text description and code analysis of the way to share the mobile end of the picture upload localresizeimg first compressed Ajax No refresh upload, the specific implementation process please see below.
Now technology is too
Case Introduction
Now there is a problem, is to submit a large text comment, the front desk to send the data back to the background of the AJAX request, and then there is a background to prevent SQL injection filter, this filter to get the data
Previously written is from the JavaScript array to obtain provincial and municipal information to achieve two-level linkage, but there seems to be a lot of demand is to get information from the database, so it needs to be based on asynchronous
Sometimes, your blog may need such a feature:
In their blog on the aggregation and display of Friends blog The latest article, so convenient for their timely understanding of friends, in addition, also facilitate visitors to find and this blog
In the recent Ajax approach to jquery, the data that needs to be returned is JSON data, and data processing in the success return differs in different ways to generate the JSON data, depending on how it is returned. In the $.ajax method should be
Ajax is a key tool for modern web application development. It allows you to send and receive data asynchronously to the server, and then parse it with Javascript. Ajax is the abbreviation for asynchronous JavaScript and XML (asynchronous JavaScript
The HTTP status code indicates:
2XX success
200 normal; The request is complete.
201 Normal; Immediately following the POST command.
202 normal; Accepted for processing, but processing has not yet completed.
203 normal; Partial information-the
An environment to build
The first is a regular spring MVC environment, and needless to say, it needs to be noted that you need to introduce the Jackson-related jar package and then add the JSON resolution-related configuration in the Spring
Url:
Requires that the requested address be sent for a string type argument, which defaults to the current page address.
Type
Requires a string type parameter, the request method (post live get) defaults to get. Note that other HTTP request
jquery is a frequently used open source JS framework in which the $.AJAX request has a Beforesend method that performs some action before sending a request to the server.
$.ajax ({
beforesend:function () {
//Handle the Beforesend event
JavaScript Ajax implements asynchronous communication
Synchronous and asynchronous communication between the browser and the server
1. Sync: is blocked, the browser after sending a request to the server has been waiting for the response of the
In the case of user registration, if you wait for the user to enter all the information, click the registration button to submit, and then verify that the input is correct, the user experience is poor, and it is a waste of time, an example is
Ajax and ScriptManager. RegisterStartupScriptThe method for running a js code segment in Ajax and cs can be:Page. ClientScript. RegisterStartupScript (Page. GetType (), "", " ");If Ajax is used on the page, the above code is ineffective even if
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