Ajax Learning Notes __ajax

Source: Internet
Author: User
A. What is Ajax?

Ajax is "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), a Web development technology that creates interactive Web applications. You can communicate with the server without refreshing the page. 1.XMLHttpRequest

1 Open ("Method", "url") establish a call to the server
2 Send (content) request to the server
3) onreadystatechange Each state change triggers this event, usually calling a function
4 readystate Request Status: 0-uninitialized, 1-loading, 2-already loaded, 3-interactive, 4-complete
5) ResponseTest: Server response
6 Status: Server's HTTP State Code instance Practice:

Realization click on the name Link Display link to the text content to the original page, do not jump page.

huan.html Content

<! DOCTYPE html>

ming.html Content

<! DOCTYPE html>

yun.html Content

<! DOCTYPE html>
1. Implement with native method: index_1.jsp code:
<%--Created by the IntelliJ idea. user:pc date:17-4-21 Time: PM 12:10 To change this template use File | Settings |
File Templates. --%> <%@ page contenttype= "Text/html;charset=utf-8" language= "java"%>  

Results:

2.load Method:

Load (Url,[data],[callback]) inserts remote HTML into the DOM
URL: Request the URL address of the page
Data: Sending to Key/value
Callback: callback function at completion of request 2.load method implementation: index_1.jsp code:

<%--Created by the IntelliJ idea. user:pc date:17-4-21 Time: PM 12:10 To change this template use File | Settings |
File Templates. --%> <%@ page contenttype= "Text/html;charset=utf-8" language= "java"%>  
2. Get. Get. Post method: 
2.get method. Post method implementation: INDEX_1.JSP code: 
<%--Created by the IntelliJ idea. user:pc date:17-4-21 Time: PM 12:10 To change this template use File | Settings |
File Templates. --%> <%@ page contenttype= "Text/html;charset=utf-8" language= "java"%>  
 article: javaee– Learning Notes  

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.