<script> btn.onclick = function(){ var xhr = new XMLHttpRequest() xhr.onreadystatechange = function(){ if(xhr.readyState == 4 && xhr.status == 200){ console.log(xhr); var res = JSON.parse(xhr.responseText) console.log(res); } } xhr.open('GET', '链接',true) xhr.send() } </script>
js ajax GET 请求方法
最新推荐文章于 2024-08-01 16:11:59 发布