Js post commit calls the method

  • 2020-03-30 01:43:44
  • OfStack

 
function post(URL, PARAMS) { 
var temp = document.createElement("form"); 
temp.action = URL; 
temp.method = "post"; 
temp.style.display = "none"; 
for (var x in PARAMS) { 
var opt = document.createElement("textarea"); 
opt.name = x; 
opt.value = PARAMS[x]; 
temp.appendChild(opt); 
} 
document.body.appendChild(temp); 
temp.submit(); 
} 

//Invoke methods such as
post('pages/statisticsJsp/excel.action', {html :prnhtml,cm1:'sdsddsd',cm2:'haha'}); 

Related articles: