用post方式開啟新視窗,並隱藏URL後面的引數

2021-08-21 09:12:09 字數 764 閱讀 1454

windowopen:function(url);   

if (url.indexof('?') != -1)

url = url.substr(0,url.indexof('?'));

}

var winformname = generuuid();

var tempform = document.createelement("form");

tempform.id = winformname;

//制定傳送請求的方式為post

tempform.method="post"

;

//此為window.open的url,通過表單的action來實現

tempform.action = url;

//利用表單的target屬性來繫結window.open的一些引數(如設定窗體屬性的引數等)

tempform.target="_blank"

; $.each(map, function(key, val) );

//將此form表單新增到頁面主體body中

document.body

//手動觸發,提交表單

tempform.submit();

//從body中移除form表單

document.body

.removechild(tempform);

}

開啟新視窗並輸出內容

一 介紹 開啟新視窗並輸出內容可以使用open 方法和close 方法來實現。open 方法 該方法用來開啟文件輸出流,並接收write 方法或writeln 方法的輸出,此方法可以不指定引數。語法 obj document.open url name obj 用來儲存open 方法返回的值,obj...

JS開啟新視窗並居中顯示

hml部分 onclick opennewwindow js部分 功能 開啟新得瀏覽器視窗並居中顯示 引數 url 需要開啟的url位址 name 開啟的視窗名稱,可以為null customwidth 視窗的寬度 customheight 視窗的高度 function opennewwindow ...

以post開啟新視窗的JQUERY實現

網路上已有此功能的函式,是以純js實現。但是在專案中發現,此函式無法相容firefox,由此我重寫了此方法.預設新視窗配置 var windowdefaultconfig new object windowdefaultconfig directories no windowdefaultconfi...