Window. open Method for passing parameters in post Mode
This article mainly introduces how window. open transmits parameters in post mode. For more information, see
The Code is as follows:
// Open a new page and PASS Parameters Using post
Function openNewPageWithPostData (postAddress, opentype, paramNames, paramValues)
{
Var newWindow = window. open (postAddress, opentype );
If (! NewWindow)
{
Return false;
}
Var postDataHtml = "
PostDataHtml = postDataHtml + "<form id = 'postdataform' method = 'post' action = '" + postAddress + "'> ";
If (paramNames & paramValues & (paramNames. length = paramValues. length ))
{
For (var I = 0; I <paramNames. length; I ++)
{
PostDataHtml = postDataHtml + "<input type = 'den den 'name ='" + paramNames [I] + "'value = '" + paramValues [I] + "'/> ";
}
}
PostDataHtml = postDataHtml + "</form> <script type =" text/javascript "> document. getElementById ("postDataForm "). submit () <script> <body>
Newmediaworkflow Doc ument. write (html );
Return newWindow;
}