Rumah > hujung hadapan web > tutorial js > window.open 以post方式传递参数示例代码_javascript技巧

window.open 以post方式传递参数示例代码_javascript技巧

WBOY
Lepaskan: 2016-05-16 16:57:57
asal
1131 orang telah melayarinya
复制代码 代码如下:

//打开新页面并利用post方式传递参数
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{
postDataHtml = postDataHtml + "";
}
}

postDataHtml = postDataHtml + "
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan