让一个表单以post的方式在window.open的窗口中打开

我们都知道window.open(url)是最基本的用法,很多人都在url里用?xx=11&yy=22的方式拼接参数,但是其实我们不愿意让使用者看到后面的参数,这时我们可以如下方法

JS如下:

var new_win=window.open("",winName,"height="+height+",width ="+width+",top="+(window.screen.height-height)/2+",
    left="+(window.screen.width-width)/2+",location =0,menubar=0,resizable=1,scrollbars =yes,status =0,toolbar =0,titlebar =0");
$(formId).method='post';
$(formId).action=action;
$(formId).target=winName;
$(formId).submit();    
new_win.focus();
原文地址:https://www.cnblogs.com/yangzhilong/p/3291023.html