Prevent printing url while window.print
I am using javascript window.print();
to print web-page. On printout, it is sh开发者_如何学JAVAowing url like http:\...
How i could avoid it?
You can't control this in javascript, it has to be done at the browser level.
This post explains how to do it in Firefox and IE http://www.howtogeek.com/howto/the-geek-blog/prevent-firefox-or-internet-explorer-from-printing-the-url-on-every-page/
What we have done in the past is just have a link explaining to the user how to do this for their browser.
EDIT
What we've also done is generate a PDF so that you can make the page look the same across all browsers. iTextSharp is a free tool to do this. Just a note, it is kinda unfriendly. There is an example here. Basically, you input HTML and it converts it to a PDF.
Add a title. It overrides the url
<head>
<title>My title</title>
</head>
精彩评论