1. 程式人生 > >JQuery提交表單

JQuery提交表單

function query(url, id) {
var str = $('#_' + id).val();
var temp = document.createElement("form");
temp.action = url;
temp.target = "_blank";
temp.method = "post";
temp.style.display = "none";
var opt = document.createElement("textarea");
opt.name = "target";
opt.value = str;
temp.appendChild(opt);
document.body.appendChild(temp);
temp.submit();
}