2024年06月04日 建站教程
在php开发中,如何利用XMLHttpRequest对象进行ajax交互,下面web建站小编给大家简单介绍一下!
具体代码如下:
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("myDiv").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "index.php", true);
xmlhttp.send();
本文链接:http://so.lmcjl.com/news/5936/