天天看點

使用POST請求打開新視窗

轉載網址:https://www.cnblogs.com/huxiaoyun90/p/5501700.html

需求:因為打開的新視窗涉及到敏感資料,客戶要求隻能檢視不能下載下傳

可能的隐性需求:要求新視窗按指定大小,不顯示位址欄/隐藏位址欄資訊/可列印

使用此方法:新打開視窗的位址欄是about:blank,但網頁可正常顯示

缺點:加載新視窗時沒有任何提示,打開的瞬間無法識别網絡故障還是正在打開。

function(keyMap,url){
    var win = window.open("","_blank","top=200,left=200,height=800,width=1247,status=yes,toolbar=no,location=no,scrollbars=yes");
     $.ajax({
        url:url;
        type:'post',
        data:keyMap,
        asyn:false
     }).done(function(data){
        var doc = win.document;
        doc.write(data);
        doc.close();
     });
}
           

轉載網址:https://www.cnblogs.com/huxiaoyun90/p/5501700.html