function clickFunc(id) {
var params = new Array();
params.push({ name: "id", value: id});
Post("/Action/method", params);
}

function Post(URL, PARAMTERS) {
//创建form表单
var temp_form = document.createElement("form");
temp_form.action = URL;
//如需打开新窗口,form的target属性要设置为'_blank'
temp_form.target = "_self";
temp_form.method = "post";
temp_form.style.display = "none";
//添加参数
for (var item in PARAMTERS) {
var opt = document.createElement("textarea");
opt.name = PARAMTERS[item].name;
opt.value = PARAMTERS[item].value;
temp_form.appendChild(opt);
}
document.body.appendChild(temp_form);
//提交数据
temp_form.submit();
}

相关文章:

  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-09-21
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-12-31
  • 2021-07-16
  • 2021-09-04
  • 2021-12-25
相关资源
相似解决方案