The project uses the AJAX technology query, the query result many times must the page display. These two days groped for a moment, here to do a summary, convenient for you to view at any time,Also convenient for posterity reference.Here's the order
XMLHttpRequest is the basis of Ajax. XMLHTTPRequest object All modern browsers support XMLHttpRequest objects (ie5 and IE6 use activexobject ). XMLHttpRequest is used to exchange data with the server in the background. This means that you can
VaR ajaxtimeouttest = $. Ajax ({URL: '', // The requested URLTimeout: 1000, // timeout value, in millisecondsType: 'get', // request method, get or postData :{}, // request parameters, in JSON formatDatatype: 'json', // returned data formatSuccess:
Preface:This section describes a small example of Using ajax to exchange data with the background. Therefore, the demo must be opened on the server. The server environment is very well established. Download Wamp or XAMPP from the Internet, install
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
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.
"> my JSP 'index. JSP 'starting page get the CD Information
Ajaxloadxmlres. xml
empire burlesque Bob Dylan USA Columbia 10.90 1985 1 Zhang San hide your heart Bonnie Taylor UK CBS Records 9.90 1988
I have a preliminary understanding of the basic knowledge of Ajax in my previous studies, but it is not practical. Then let's test the truth through practice!
Basics: http://blog.csdn.net/liu_yujie2011com/article/details/29812777
So let's take a
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:
1. ajaxform
Purpose:
(1) pre-load JS events to form
(2) Submit the JS verification form before the action
(3) After submitting the action, the result will be processed by JS and will not be automatically redirected.
Requirements:
Example:
Done
[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
To use anonymous functions to Implement User existence, you should understand: What is an anonymous function? What is it? How to use it? How can I implement it with Ajax? Then we will go into the study with questions:1. What is it?
"Anonymous"
The full name of AJAX is Asynchronous JavaScript and XML. Asynchronous is asynchronous, which is different from the synchronous method used in traditional web development.
Example: Ajax working principle diagram and Web working principle diagram
1.
Use Ajax and IFRAME nesting to partially refresh the page. The javascript code is for reference only and needs to be modified as needed.? 1. [Code] JavaScript codeFunction cj_start (depname, groupid ){VaR URLs = "/usergather. Action ";VaR status = ""
Atitit. Ajax best practices and framework Selection
1. Selection framework DWR/dwr3 and JQ 1
2. the convenience of DWR is divided into two parts. 1
3. Advantages of DWR: 1
4. Disadvantages: 2
5. Differences between root JQ 2
1. Selection
1. When a GET request is used, the parameter is displayed in the URL, but the POST method is not displayed, so the POST method is safer (same as Article 4 ).
2. For the get method, the server uses request. querystring to obtain the value of the
1. What is Ajax? The full name of AJAX is asynchronousjavascript + XML.2. Ajax definition:Ajax is not a technology. It is actually several technologies, each of which has its own unique characteristics. Together, Ajax becomes a powerful new
An actual example of w3school [1]:
let Ajax change this text change content through Ajax
Pay attention to the code order of the red part of the subscript. If you change the code to the following order:
let Ajax change this text
Use ajax technology to dynamically call Sina stock real-time data without refreshing, and ajax shares in real time
Sina's financial channel has always felt that it is doing well. However, due to the slow speed recently, the webpage cannot be opened
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