Re: [問題] Firefox XMLHttp POST遇到的問題
firefox用POST傳資料時 要設定MIME TYPE
可參考這篇文章
https://developer.mozilla.org/en/AJAX/Getting_Started
於是修改如下
※ 引述《mhsu2k9 (mhsu2k9)》之銘言:
var postData = "A=1&B=2&C=3&D=4"; //POST的參數
if(window.ActiveXObject){
var xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
}else{
var xmlhttp2 = new XMLHttpRequest();
}
xmlhttp2.onreadystatechange=state_Change2;
xmlhttp2.open("POST",postUrl,true);
xmlhttp2.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
xmlhttp2.send(postData);
function state_Change2(){
if(xmlhttp2.readyState==4){
//200=OK
if(xmlhttp2.status==200){
alert("Post OK_");
}
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.248.90.133
※ 編輯: mhsu2k9 來自: 60.248.90.133 (02/24 17:11)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.25.44.141
→
02/25 23:00, , 1F
02/25 23:00, 1F
→
02/25 23:01, , 2F
02/25 23:01, 2F
→
02/26 00:53, , 3F
02/26 00:53, 3F
→
02/26 00:53, , 4F
02/26 00:53, 4F
→
02/26 00:56, , 5F
02/26 00:56, 5F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章