[英]HTML Print a Page with JS
我有一個問題,用 html 打印 function。 所以我的計划如下。 我在 /help-center/ 文件夾中有一個頁面作為 index.html。 所以我想做以下事情:如圖所示,有一個“打印”鏈接。 所以當用戶點擊它時,它應該打印 /help-center/pdf/terms.html 文件。
這是一個代碼:打印此頁
我想這樣做來設置參數以打印 /help-center/terms.html 頁面
據我了解,這就是你想要的?
function printPreview(){
var targetFile= window.open('/path/to/file');
targetFile.print();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.