Examples of two methods of using POST to pop up Windows

  • 2020-03-30 01:36:47
  • OfStack

Recently I need to make a popover for a function, but I can't use the get method, because the get method has a limit on the length of the url, so I must use post, which summarizes two methods

var $form1=$("<form action='"+url+"' id='f' name='f' method='post'></form>"); 
$form1.append($("<input type='hidden' name='"+i+"' value='"+params[i]+"'/>")); 
var scriptStr="<script type='text/javascript'>document.f.submit();</script>"; 
var newWindow=openwin("",null,800,600); 

var $form1=$("<form action='"+url+"' id='f' name='f' target='newWindow1' method='post'></form>"); 
for(var i in params){ 
$form1.append($("<input type='hidden' name='"+i+"' value='"+params[i]+"'/>")); 
var newWindow=openwin("",'newWindow1',800,600); 

These two methods are not too bad in effect, they both pop up a window, and then let the popup window to post

Related articles: