天使半只翼

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
var req = new XMLHttpRequest();if (req != null) {    req.onreadystatechange = function() {        //// Checks the asyn request completed or not.        if (req.readyState == 4) {            if ((req.status >= 200 && req.status < 300) || req.status == 304) {                alet(req.responseText);    //获取成功就弹出取得的内容            } else {                alert("Request was unsuccessful: " + req.status);            }        }    };    req.open("GET",URL, true);    //url是获取的地址    req.send(null);};

 

 
 
posted on 2012-08-12 20:20  天使半只翼  阅读(3747)  评论(0编辑  收藏  举报