﻿// JScript 文件

var xmldownloadhttp;
function GetDownloadData()
{
   document.getElementById("news_download").innerHTML ="<div style='width:100%;text-align:center;vertical-align:middle;'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='80' height='70'><param name='movie' value='images/wait.swf' /><param name='quality' value='high' /><embed src='images/wait.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='80' height='70'></embed></object></div>";
	//创建异步对象
    xmldownloadhttp = new ActiveXObject("Microsoft.XMLHTTP");
    //判断状态事件的方法
    xmldownloadhttp.onreadystatechange = stateDownloadChange;
    //加载服务器－注意无参数
    xmldownloadhttp.Open("GET","Download/DownloadDataPage.aspx?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();

