Home  >  Article  >  Web Front-end  >  ajax study notes

ajax study notes

php中世界最好的语言
php中世界最好的语言Original
2018-03-19 16:25:181752browse

This time I bring you the study notes of ajax. What are the precautions when using ajax? Here are practical cases, let’s take a look.

XMLHttpRequest prototypeObject

##let xhr = new XMLHttpRequest(); //new an XMLHttpRequestInstance of constructor: xhr, open, send, status, onreadystatechangeInheritanceSince XMLHttpRequest;

Whenever readyState changes, the onreadystatechange event will be triggered.

xhr request:

xhr.open('GET','http ://118.25.16.102:3000/user/hive_post_cascader',true); //

readyState: 1, the server connection has been established;

xhr.send(); //readyState: 4

, The request has been completed and the response is ready

I believe you have mastered the method after reading the case in this article. Please come for more exciting information. Follow php Chinese website

Other related articles!

Recommended reading:

Request cross-domain solution CORS

##react-native flatlist pull-up loading onEndReached triggers frequently solve

The above is the detailed content of ajax study notes. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn