复制代码代码如下:
// post方式传递参数
函数OpenNewPageWithPostData(Adddress,Opentype,paramnames,progarvalues)
{
var newwindow = window.open(postaddress,opentype);
如果(!newwindow)
{
返回false;
}
var postdatahtml =“ <html> <head> </head> <body>”;
postDatahtml = PostDatahtml+“ <form ID ='PostDataform'method ='post'poction ='“”+PostAddress+“''>”;
if(paramnames && paramvalues &&(paramnames.length == paramvalues.length)))
{
for(var i = 0; i <paramnames.length; i ++)
{
postDatahtml = PostDatahtml+“ <input type ='隐藏'name ='“+paramnames [i]+”'value ='“+paramvalues [i]+“+”''/>“;
}
}
PostDatahtml = PostDatahtml +“ </form> <script type =/” text/javascript/“> document.getElementById(/” postdataform/“)。
newwindow.document.write(html);
返回Newwindow;
}