SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Sep 15, 2003, 04:57 #1
How to turn off headers and footers in IE
Does anyone know of a way to turn off headers and footers in IE using javascript, so when someone goes to print a page they wont get the url and other stuff on the print-out?
I know it can be done using through the browser menu. But I wanted to make it automatic so the user doesn't have to. Done a search on google and can't seem to find anything to help. Can it even be done?
Cheers!
Richard.
-
Sep 15, 2003, 05:34 #2
- Join Date
- Sep 2003
- Location
- Stockholm
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You cant do it with JavaScript.
Theoretical you should be able to make an ActiveX component and by running that turning off headers and footers, but thats some helluva time to spend and not quite realistic.*They call us apes*
-
Sep 15, 2003, 12:55 #3
Oh ok. That's a shame but I thought that was going to be the case. Thanks.
-
Sep 15, 2003, 22:38 #4
- Join Date
- Aug 2003
- Location
- Melbourne, Australia
- Posts
- 454
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try CSS
This can actually be achieved using CSS. Say for example that you have the following HTML code:
Code:<html> <body> <div id="myHeader">Logo etc.</div> <div>Main content blah blah blah</div> <div id="myFooter">Disclaimer link, copyright blah blah</div> </body> </html>
Code:@media print { #myHeader { display: none; } #myFooter { display: none; } }
-
Sep 16, 2003, 04:31 #5
- Join Date
- Apr 2001
- Location
- Sarnia, Ontario, Canada
- Posts
- 434
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I believe he meant the headers and footers that are added to each printed page (with the URL, date, and page title) from Internet Explorer. These cannot be controlled with CSS or Javascript (unfortunately, they can get annoying).
Love it? Hate it? Helpful? Useless?
Use the rate button to let me know what you think of my post!
-
Sep 16, 2003, 15:59 #6
- Join Date
- Aug 2003
- Location
- Melbourne, Australia
- Posts
- 454
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by ucahg
-
Sep 16, 2003, 19:04 #7
- Join Date
- Jan 2002
- Location
- London
- Posts
- 3,509
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Because such programmatic access would be open to potential abuse, this is currently not possible without a custom ActiveX component (as Arve has said). However, given what's just happened regarding IE, in the future that might not be an option either...
MarcusJT
- former ASP web developer / former SPF "ASP Guru"
- *very* old blog with some useful ASP code
- Please think, Google, and search these forums before posting!
Bookmarks