待进一步的完善:
function get(url,callback){ let http = new XMLHttpRequest(); http.onload = function(){ callback(http.responseText); } http.open("get",url,true); http.send(); } get ("data.json",function(data){ console.log(data); })
基于原生XMLHttpRequest()封装get方法
Guess you like
Origin blog.csdn.net/L_Z_jay/article/details/113785088
Ranking