ajax(1)helloword(GET)

前端之家收集整理的这篇文章主要介绍了ajax(1)helloword(GET)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<script>

window.onload = function(){

var elem = document.getElementByTagName("a");

elem.onclick = function(){

var url = this.href;

var method = "GET";

elem.open(method,urrl);

elem.send(null);

elem.onreadystatechange = function(){

if(elem.readystate == 4){

if(elem.state == 200 || elem.state == 304){

alert(elem.requestText);

}

}

}

}

猜你在找的Ajax相关文章