A package for AJAX
//url is the request address//successFunc is a function after a request returns successfully. There is a parameter, and the parameter is the message body returned by the server ajax(url,successFunc){ var xhr = window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); xhr.open("POST",url,true); xhr.onreadystatechange = function(){ if(xhr.readyState == 4) { if(xhr.status == 200) { successFunc(xhr.responseText); } else { alert("Server returns error!"); } } } }; xhr.send();}The above content is the example code for sending AJAX request from Javascript introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message. The editor will reply to everyone in time!