function CreateXmlHttp()
{
var A=null;
try
{
A=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try
{
A=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(oc){
A=null;
}
}
if ( !A && typeof XMLHttpRequest != "undefined" )
{
A=new XMLHttpRequest();
}
return A;
}
//更新使用者個人介紹資訊
function editDigital(username,digital)
{
var xmlHttp;
xmlHttp=CreateXmlHttp();
xmlHttp.open("post","http://www.ideacool.net/service/ajax.asmx/updateUserDigital",false);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.Send("digital="+digital+"&username="+username);
if(xmlHttp.status!="200")
{
alert("發生錯誤!");
}
else
{
xml=xmlHttp.responseText;
var xmldoc=new ActiveXObject("Microsoft.XMLDOM");
xmldoc.async=false;
xmldoc.loadXML(xml);
var rootElement=xmldoc.documentElement;
var result=rootElement.text;
if(result=="error")
{
alert("修改失敗!");
}
else
if(result=="ok")
{
alert("個人介紹修改成功!");
}
}
}
function showIdeaList(cid,nPageNo,nPageNum)
{
window.document.getElementById("IdeaList").innerHTML="正在載入點子,請稍候...";
var xmlHttp;
xmlHttp=CreateXmlHttp();
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==4)
{
if(xmlHttp.status!="200")
{
window.document.getElementById("IdeaList").innerHTML="載入出錯";
}
else
{
xml=xmlHttp.responseText;
window.document.getElementById("IdeaList").innerHTML=xml;
}
}
}
xmlHttp.open("POST","http://www.ideacool.net/service/getIdeaList.asp",true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.Send("cid="+cid+"&page="+nPageNo+"&pageNum="+nPageNum);
}