【问题标题】:How to remove unwanted content like url while print automatically in jquery如何在jquery中自动打印时删除不需要的内容,如url
【发布时间】:2021-04-16 07:55:43
【问题描述】:

我正在尝试使用 jQuery 自动打印我的页面。但问题是出现红点圆圈。那么如何删除它们?3

这是我的html文件的样子

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
   
    <title>Document</title>
</head>
<body>
<div>
    Hello From Other side
</div>



<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script>
    window.onload = function () {
        window.print();
    }
</script>
</body>
</html>

所以我想删除那个红点圆圈部分,比如网址名称和标题名称。

【问题讨论】:

  • 进入更多设置并取消勾选选项页眉和页脚

标签: javascript html jquery


【解决方案1】:

请从此链接How to remove the URL from the printing page?试试这个

   <style media="print">
        @page {
            size: auto;
            margin: 0;
        }
    </style>

【讨论】:

    【解决方案2】:

    它是浏览器的默认行为。您应该取消选中标题复选框

    【讨论】:

      猜你喜欢
      • 2011-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-23
      相关资源
      最近更新 更多