3
所以我用這個職位的要求,我發現就在這裏從一個JavaScript POST請求的響應,但我想知道我是如何收到使用該響應...如何獲得
function post_to_url(path, params, method) {
method = method || "post";
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}ody.appendChild(form);
form.submit();
}
謝謝提前。
看看AJAX。比提交表單更適合你的目的。 – Sirko 2013-02-13 16:26:12