国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

window.open 以post方式傳遞參數示例代碼

2024-05-06 16:01:51
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了window.open以post方式傳遞參數的方法,需要的朋友可以參考下

復制代碼 代碼如下:


//打開新頁面并利用post方式傳遞參數
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 method='post' action='"+postAddress+"'>";

if (paramNames && paramValues && (paramNames.length == paramValues.length))
{
for(var i=0 ; i<paramNames.length ; i++)
{
postDataHtml = postDataHtml + "<input type='hidden' value='"+paramValues[i]+"'/>";
}
}

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 信宜市| 和平县| 兰坪| 伽师县| 广元市| 辽宁省| 依安县| 同心县| 武冈市| 永泰县| 民乐县| 丹江口市| 离岛区| 福安市| 平阴县| 忻城县| 宁河县| 霍林郭勒市| 柳河县| 图木舒克市| 高邑县| 扎鲁特旗| 金溪县| 土默特右旗| 景东| 南江县| 榆树市| 隆昌县| 延吉市| 巴彦淖尔市| 云阳县| 曲沃县| 垦利县| 宕昌县| 东莞市| 喀什市| 巴马| 江源县| 海林市| 沅陵县| 临夏市|