當前位置:編程學習大全網 - 網站源碼 - 請問高手百度貼吧中“頂”的源代碼是怎麽寫的

請問高手百度貼吧中“頂”的源代碼是怎麽寫的

是用AJAX寫的

xmlhttp對象直接get壹個aspx程序

if(window.ActiveXObject)

{

xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

}

else if(window.XMLHttpRequest)

{

xmlHttp = new XMLHttpRequest();

}

try

{

xmlHttp.onreadystatechange = handleStateChange;

xmlHttp.open("GET","checkuser.aspx?uname=abc&pwd=123",false);

xmlHttp.setRequestHeader("If-Modified-Since","0");

xmlHttp.send(null);

if (xmlHttp.status == 200 || xmlHttp.status == 0)

{

htmlstr=xmlHttp.responseText;

// 解析壹下這個串,找出xml裏的成功失敗。

alert(htmlstr);//這裏能獲取htmlstr

}

}

catch(exception)

{

alert("您要訪問的資源不存在!");

}

  • 上一篇:東方財富的公式編輯器總是顯示:“0條件選股公式只能有壹個輸出!”
  • 下一篇:托盤源代碼
  • copyright 2024編程學習大全網