I don't think we need to make too many comments about the advantages of Ajax technology. ajax technology is now widely used in web applications, such as google Maps and provincial/municipal connections.
AJAX = Asynchronous JavaScript and XML.
AJAX is a technology for creating fast dynamic web pages.
AJAX allows asynchronous updates on webpages by exchanging a small amount of data with the server in the background. This means that it is possible to update part of the webpage without reloading the whole page.
I am not talking about it. Now I will use pure javascript to implement ajax technology.
The first is the jsp page:
<Html>
The servlet on the server side is very simple, that is, a piece of text content is returned to the client.
The core of ajax technology isXmlHttpRequest,For IE, because its kernel is different from other browsers (Firefox, Chrome), you must first determine whether the browser is IE
If (window. activeXObject) // IE browser {xmlHttpRequest = new ActiveXObject ("Microsoft. XMLHTTP ");} else if (window. XMLHttpRequest) // other browsers except IE {xmlHttpRequest = new XMLHttpRequest ();}
After xmlHttpRequest is obtained, the subsequent operations are reflected in the Code above. The process is nothing more than sending a request like a servlet, and then calling the callback function according to the change in response status, finally, the server obtains the response data, which can be xml, json, or plain text,