[Ajax for front-end and back-end interaction]

Front-end and back-end interaction Ajax

Ajax: async (asynchronous) javascript xml (closed tag) (data can be updated without refreshing the page)
Josn.parse() converts the array into an object
Render()
1 Create XHR new XMLHTTPRequest()
2. Configure open (request method (GET (biased to obtain data) or POST (biased to submit data or Put (biased to update all updates and patch updates) Delete (biased to delete information), request address, whether asynchronous) default true means asynchronous request false means synchronous request ** asynchronous will
insert image description here
not Cause blockage
3.Send() Send request

insert image description here
4. When the parsing is equal to 4, ajax data parsing is completed
5.responseText gets the data

insert image description here
and judges the result
insert image description here
Mapping the obtained data Map()
When the backend has not prepared the data for you You can fake data like the following format

Guess you like

Origin blog.csdn.net/qq_55248236/article/details/127160332