var Result = ''; var oAjax = new XMLHttpRequest(); oAjax.open('POST', '', false); oAjax.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); oAjax.onreadystatechange = function() { if (oAjax.readyState == 4 && oAjax.status == 200) { Result = oAjax.responseText; } else { console.log(oAjax); } }; oAjax.send(''); return Result;
同步发送会等待并返回结果,在某些特定的环境中使用
已有 5761 位网友参与,快来吐槽:
发表评论