How Ajax reads data
This article is about how Ajax reads data. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Take out what we prepared last time. 1: function of XMLHTTPRequest object. 2: Asp outputs a file in xml format. You can click to view the contents of the file: Asp outputs data in xml format.
After opening it, you will find that we use Asp technology to dynamically output a xml format data. if you don't know about this technology, please go back and read: ajax begins to prepare an article with a msg tag in this output data. the tag contains a piece of text. today we read this msg tag. and display the text content on your web page.
Take a look at the following code first. and attach a demonstration of the effect
Web_ajax.asp
The copy code is as follows:
A simple example of Asp outputting xml, which we will use to read data in our ajax tutorial example later.
Html
Css
Dom
JavaScript
Ajax
Here is the content of the static page
The copy code is as follows:
Create an available xmlhttpreuqest object