js post方式传递提交的实现代码
程序员文章站
2024-02-10 17:18:46
复制代码 代码如下:var myform = document.createelement("form"); myform.method="get" ; myform.ac...
复制代码 代码如下:
var myform = document.createelement("form");
myform.method="get" ;
myform.action = "line_ticket.aspx" ;
var myinput = document.createelement("input") ;
myinput.setattribute("name", "id") ;
myinput.setattribute("value", idstr);
myform.appendchild(myinput) ;
var myinput2 = document.createelement("input") ;
myinput2.setattribute("name", "fid") ;
myinput2.setattribute("value", fid);
myform.appendchild(myinput2) ;
var myinput3 = document.createelement("input") ;
myinput3.setattribute("name", "unlock") ;
myinput3.setattribute("value", unlock);
myform.appendchild(myinput3) ;
var myinput4 = document.createelement("input") ;
myinput4.setattribute("name", "option") ;
myinput4.setattribute("value", "del");
myform.appendchild(myinput4) ;
document.body.appendchild(myform) ;
myform.submit() ;
document.body.removechild(myform) ;