form 表格提交

 1   //根据partnerId获取相关合作方的的跳转路径及生成的签名信息等
 2     var settings ={
 3   'url':'',
 4   "method":"",
 5       "timeout":0,
 6       "headers":{
 7          "Content-Type":"application/x-www-form-urlencoded"
 8     },
 9       "data":{
10      "_parterId":"10309219301"
11   },
12        
13 }
14  var partner = {};
15 $.ajax(settings).done( function (response){
16    
17     partner = response;
18   }
19    
20 )
21 
22 var  url = partner.url;
23 
24 var args = {
25  "_partnerId":"",
26  "channel":"",
27  "userInfo":"",
28  "temestamp":"",
29  "signature":"",
30  "tradeNo":"",
31  "grantType":"",
32  
33 
34 }
35 
36 
37 
38 var form = $(" <form metod = 'post' ? </form>");
39 form.atttr({action:url})
40 for(var arg in args){
41 
42       var input = $.(" <input type='hidden'> ")
43       input.attr({name:arg})
44       input.val(args[arg])
45       form.append(input)
46 }
47 $(document.body).append(form);
48 form.submit()
49 
50 
51 
52 
53 
54 
55 
56     
57      

 

posted @ 2021-09-27 14:27  徒步阳光855  阅读(37)  评论(0编辑  收藏  举报