欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

window.open 以post方式傳遞參數(shù)示例代碼

 更新時(shí)間:2014年02月27日 11:24:02   作者:  
這篇文章主要介紹了window.open以post方式傳遞參數(shù)的方法,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

//打開新頁面并利用post方式傳遞參數(shù)
function openNewPageWithPostData(postAddress,opentype,paramNames,paramValues)
{
var newWindow = window.open(postAddress,opentype);
if (!newWindow)
{
return false;
}

var postDataHtml="<html><head></head><body>";
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='hidden' name='"+paramNames[i]+"' value='"+paramValues[i]+"'/>";
}
}

postDataHtml = postDataHtml + "</form><script type=\"text/javascript\"> document.getElementById(\"postDataForm\").submit()<script><body><html>";
newWindow.document.write(html);
return newWindow;
}

相關(guān)文章

最新評(píng)論