ajax对服务端发送请求

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

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

posted @ 2018-05-12 18:48  wangzhenxiang  阅读(114)  评论(0编辑  收藏  举报