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

