<!--PHP编程实战-->
<!--JSON & Ajax -->
<!--15-4-->
<!--基本的XMLHttpRequest(异步)-->
<script type="text/javascript">
var xhr = new XMLHttpRequest();
xhr.open("GET", "animal.xml");
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 2000) {
alert('success');
}
else {
alert("error");
}
}
}
xhr.send("our content");
</script>
网友评论