POST 和 GET 傳參數時用的方法不一樣
POST
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.send(string);
GET
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
GET 不需要設定 Header ! send 時也不用任可參數,只要在 URL 上加上參數就可以了 ~
終於 GET 和 POST 都可以傳了 ~ 呼
4.21.2010
AJAX POST, GET
張貼者:
Jean Pan
於
星期三, 4月 21, 2010
訂閱:
張貼留言 (Atom)



沒有留言:
張貼留言