當前位置:編程學習大全網 - 電腦編程 - 怎麽用ajax的post向服務器發送請求

怎麽用ajax的post向服務器發送請求

// 主過程

function startXMLHttp(){

createXMLHttp();

var send_string="name="+document.getElementById("name").value;

send_string= encodeURI(send_string)

xmlHttp.onreadystatechange =stataHandler;

xmlHttp.open("post","ajax_show.php",true);

// xmlHttp.setRequestHeader("cache-control","no-cache");

// 以下兩句用POST 時不可少,LZ 參考下

xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

xmlHttp.send(send_string); //發送

}

  • 上一篇:Rhino裏如何在曲面上寫立體字啊?麻煩說詳細壹些。。。
  • 下一篇:廈門微亞智能值得去嗎
  • copyright 2024編程學習大全網