我有以下的javascript函數,我想轉換到jQuery呢:轉換js函數到jQuery函數
function confirm() {
var http = new XMLHttpRequest();
var url = "index.php?tag=' . $dt . '";
var params = "confirm_ref=' . urlencode(encrypt($br,$k)) . '";
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
}
}
http.send(params);
}
關於如何正確設置它的任何指針? 謝謝。
https://api.jquery.com/jquery.post/ – j08691
...我的意思是,剛剛在看的'$ .post'或'$ .ajax'文檔應該足夠了。 –
'$ .post(url,{data:params})。done(function(){...});' –