For example:var data = {No: "001", Name: "Zhang San", Score:[80,75,82,66,70]}$.post (Url,$.param (data,true), callbackfunc);GrammarJquery.param (object,traditional)
Parameters
Description
Object
The array or
FEEDBACK.JSP: " > Feedback information Bootstrap-3.2.0-dist/css/bootstrap.css "> Bootstrap-3.2.0-dist/css/bootstrap-theme.css "type=" text/css "> Feedback & lt;/div> e-mail address Equipment id Phone number Body Time $
Typically, the AJAX request returns the format JSON or XML, and if it returns JSON, it can be manipulated by converting it to a JavaScript object, as follows:1, the controller implementation of the AJAX request@RequestMappingpublic void Getlocations
The core of Ajax technology is the XMLHTTPRequest object (xhr ).XMLHTTPRequest objectCreate an xhr object in the browser as follows and use the XMLHttpRequest constructor.VaR xhr = new XMLHttpRequest ();Xhr usageXhr. Open ("get", "example. php",
Paste the sample code, which is valid in IE (sogou is ineffective), and others are not tested.
The getdate. ashx page only returns the server time, which is useless. The Code is as follows:
Public void processrequest (httpcontext context
First, generate and output XML documents on the PHP page, and then process XML data in JS:
VaR xhr = createxhr (); xhr. onreadystatechange = getinfo; xhr. open ("get ",'. /07. PHP '); xhr. send (null); function getinfo () {If (xhr. readystate = 4 &
pull down pull down pull down pull down pull down pull down pull down pull down move down pull pull down pull down pull down pull down / p> pull down pull down pull down pull down pull down pull down pull down
Since I learned Ajax, it has been in the fog in the cloud. I want to summarize it, but I have no way to start it. After reading DRP recently, Mr. Wang Yong briefly talked about Ajax and made another explanation of the Technical and technical things.
When jquery Ajax is used to call data asynchronously, the first normal return value can be returned, and the background will not be executed. The first access result is always returned. Even if Ctrl + F5 is used, the latest data cannot be
I. Basic differences between get () and post ()1. Get is to add the parameter data queue to the URL referred to by the Action attribute of the submission form. The values correspond to each field in the form one by one and can be seen in the URL.
Create a request object
When a request object is created, the following statements are always immediately reflected.
var request=new XMLHttpRequest();
However, it is not that simple because of the fierce competition between various browsers.
For web development, Ajax is indispensable now. ecshop encapsulates its own Ajax call function, which is very convenient to use. The following describes his practical functions.
Ajax. Call ('user. php? Act = chk_user ', 'username =' + username,
1. Struts. xml settings
checkresult
2. html and JS. The form page to be submitted contains two JS files: jquery. js (download a version at Will) and username_check.js (as shown below)
User Name verify the user name
VaR user = {inintevent:
[Function description] We usually need to enter the user name when registering a website. However, if we enter the user name we like, we can leave the input box and sometimes remind you that the user name has been registered, however, other content
In jquery, the page Ajax method $. load function, jquery. load
Load syntax
$ (". Selector"). load ("url", function (responseText, statusText, xmlhttprequest ));
When loading a page, if an error occurs, the corresponding prompt is displayed based on
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