直接看代码:
function openWindowByPost(url,name1,value1,name2,value2){
var newwindow=window.open(url);
newwindow.document.write(
<html>
<body>
<form id="formidA" action='+url+',method="post">
<input type="hidden" name='+name1+' value='+value1+' />
<input type="hidden" name='+name2+' value='+value2+' />
</form>
</body>
</html>);//封装一个form表单
return newwindow;
}
//调用
newwindow= openWindowByPost(url,name1,value1,name2,value2);
newwindow.document.getElementById('formidA').submit();
//搞定