This article mainly introduces information about examples of JavaScript Native xmlHttp and jquery ajax methods in json data format. For more information, see
Javascript ajax sends requests
(1) Create an XMLHttpRequest object. This object is the core of ajax requests and is the information carrier of ajax requests and responses. It is created in different browsers in different ways.
(2) Request Path
(3) Use the open Method to bind and send requests
(4) use the send () method to send requests
(5) obtain the xmlhttpRequest. responseText string returned by the server;
(6) obtain the value returned by the server and store xmlhttpRequest. responseXML as an xml object;
(7) Check and parse the XML Document Object using the W3C DOM node tree method and attributes.
Preface:
Recently, with the launch and implementation of the project, I am a little idle. In my spare time, I accidentally found the javascript Native xmlHttp ajax method and the jquery plug-in ajax method, so I will make some summary, tests were not performed on all browsers due to time. Currently, several IE8, 9, 10, Google Chrome, Mozilla Firefox, and Opera versions are commonly used. If problems are found during verification tests, please give me feedback in time. Thank you.
Let's get down to the truth and directly go to the Code:
Front-end code
Ajax exercises