﻿// JScript 文件

var xmlinfohttp;
function GetInfoData()
{
    document.getElementById("news_info").innerHTML = "<div style='width:100%;text-align:center;vertical-align:middle;'>数据加载，请稍候...</div>";
	//创建异步对象
    xmlinfohttp = new ActiveXObject("Microsoft.XMLHTTP");
    //判断状态事件的方法
    xmlinfohttp.onreadystatechange = stateInfoChange;
    //加载服务器－注意无参数
    xmlinfohttp.Open("GET","News/NewsDataPage.ashx?newsflag=info&num=12",true);
    //发送请求－无参数
    xmlinfohttp.Send(null);              
}

function stateInfoChange()
{
   //readystate==4表示请求已完成
   if(xmlinfohttp.readystate==4)
   {
     //status==200表示已经成功返回
     if(xmlinfohttp.status==200)
     {
        //动态创建元素显示获取的数据
        document.getElementById("news_info").innerHTML = xmlinfohttp.responseText;
     }

   }
   
}

GetInfoData();
