ajax对服务端发送请求

//兼容处理获取ajax对象
var req = '';
if (window.XMLHttpRequest)
    req = new XMLHttpRequest();
else
    req = new ActiveXObject("Msxml2.XMLHTTP");

//建立连接
req.open('get', 'demo.php');
//发送请求
req.send();

猜你喜欢

转载自www.cnblogs.com/wangshengl9263/p/9029526.html