Handwriting ajax

var request = new XMLHttpRequest () // Create an XML object

request.open ( 'GET', url); // send mode setting request and the address of the text

request.onreadystatechange = function(){

  if(request.readyState === 4 && request.status === 200){

    console.log ( "Request success")

  });

}

request .send()

Guess you like

Origin www.cnblogs.com/zhoujingye/p/12515647.html