Home > Web Front-end > JS Tutorial > window.open passes parameters in post mode sample code_javascript skills

window.open passes parameters in post mode sample code_javascript skills

WBOY
Release: 2016-05-16 16:57:57
Original
1134 people have browsed it
Copy code The code is as follows:

//Open a new page and use post method to pass parameters
function openNewPageWithPostData(postAddress,opentype,paramNames,paramValues)
{
var newWindow = window.open(postAddress,opentype);
if (!newWindow)
{
return false;
}

var postDataHtml="";
postDataHtml = postDataHtml "
";

if (paramNames && paramValues ​​&& (paramNames.length == paramValues.length))
{
for(var i=0 ; i< paramNames.length ; i )
{
postDataHtml = postDataHtml "";
}
}

postDataHtml = postDataHtml "
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template