📜  避免浏览器弹出阻止程序 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:42.378000             🧑  作者: Mango

代码示例1
printButtonClicked: function(){
    $.post("/ajax/friendlyPrintPage", postData).done(function (htmlContent) {
        var id = (new Date()).getTime();
        var myWindow = window.open(window.location.href + '?printerFriendly=true', id,
        "toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=800,height=600,left = 240,top = 212");
        myWindow.document.write(htmlContent);
        myWindow.focus();
    })
}