View Full Version : Changing IE Headers and Footers in Javascript?

03-15-2005, 04:18 PM
If you want to stop the header and footer from being displayed when you print something out in Internet Explorer you can simply go into the Page Setup and remove the "&w&bPage &p of &P" for the header and "&u&b&d" for the footer, which show the page numbers and URL.

However, I am developing a web application for a number of users and they will not want to have this URL and the page number displayed. Instead of going around to each PC and change the page setup settings in their internet explorer - is it possible to modify the header and footer values with JavaScript code in the web page that the user will want to print. And if so how is this achieved. If there is a previous discussion on this please point me to the thread.


03-15-2005, 04:41 PM
Hi Starlight,

Straight answer : No you cannot change print settings using javascript.

Remember that javascript can only do anything inside your webpage. You cannot access clients resources like page setup or, desktop icons, or control panel and not even menus of your own browsing window. The only options you can access using javascript are as below.

1.Location bar to naviagate to some other page.
2.Back and forward buttons using code like history.back();
3.Window events like onload and onunload.
4.Anyevents that occur inside the browser document window. Like keypress, mouseclick

I think that completes the list. If somebody can add a few other it will be helpful to newbies.

Have a nice day :)