原生js实现post提交


//原生js实现post提交
var url = "http://localhost:8080/culcleasing/print/print/proj_print_comment.jsp";    
var postForm = document.createElement("form");//表单对象     
postForm.method="post" ;     
postForm.action = url;  
var roleidInput = document.createElement("input") ;     
roleidInput.setAttribute("name", "pa") ;     
roleidInput.setAttribute("value", pa);  
postForm.appendChild(roleidInput);            
document.body.appendChild(postForm) ;  
postForm.submit() ;     
document.body.removeChild(postForm) ;

猜你喜欢

转载自blog.csdn.net/kevin_cat/article/details/80178484
今日推荐