﻿// JavaScript Document
var xmlHttp;
function CreateXmlHttp()  //创建AJAX
{
	if(window.ActiveXObject) //判断是否为IE
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
    else if(window.XMLHttpRequest) //为其它浏览器
	    xmlHttp = new XMLHttpRequest();
}
function getInfo()
{
	CreateXmlHttp();
	xmlHttp.open("GET","http://news.xhu.edu.cn/showzb.php",true);
	xmlHttp.onreadystatechange = Go;
	xmlHttp.send(null);
}
function Go()
{
	if(xmlHttp.readyState==4 && xmlHttp.Status==200) //判断服务器响应是否完成
	{
	 var  info = xmlHttp.responseText;
	 document.getElementById('zhuban').innerHTML=info;
	}
}
function getqfr(id){
	   CreateXmlHttp();
	   xmlHttp.open("GET","http://news.xhu.edu.cn/getqfr.php?id="+id,true);
	   xmlHttp.onreadyStatechange=function(){
		   if(xmlHttp.readyState==4 && xmlHttp.Status==200)
		   {
			   var q=xmlHttp.responseText;
			   document.getElementById('qfr').innerHTML=q;
			   }
		   }
		   xmlHttp.send(null);
}