开发者

exclude javascript code from print function

开发者 https://www.devze.com 2022-12-30 18:29 出处:网络
I have a print function on a page in my website. the problem is, when it hits this line: <script type=\"text/javascript\" src=\"http://cdn.powerreviews.com/repos/12564/pr/pwr/engine/js/full.js\">

I have a print function on a page in my website. the problem is, when it hits this line: <script type="text/javascript" src="http://cdn.powerreviews.com/repos/12564/pr/pwr/engine/js/full.js">开发者_高级运维</script>, it tries to load it, and just never finishes.

Any ideas on how to get around that?


You could use the CSS @media rule for this.

<a class="noprint">foo</a>

and then add a @media print rule to your CSS which hides the elements during print:

@media print {
    .noprint {
        display: none;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消