Common questions: How do I change the header and footer on IE when printing? How do I change the elements on the current browser window? To both of these, the answer is "You can't." I wrote this FAQ because there is a general misunderstanding about the relationship
between the browser and the server. The browser is designed to protect the computer it's on against invasive actions from the server. Its a private environment. The server is not provided any DOM/DHTML methods or JavaScript statements that break this rule.
To maintain this privacy, your JavaScript can only do these things to the browser: - modify the contents of the current window. Since this window will only contain HTML and code supplied by the server, you aren't editing anything on the computer beyond that
HTML. - open a new window. (This action can define attributes of the window when using the DOM/DHTML method window.open().) - actions that print or move through page history (these don't affect anything outside the current window) - modify the size and position
of the current window. For the last 3 of these, see the documentation on the
window and
history classes. If you look at the
navigator object (which describes some qualities of the IE browser), you will see that its properties and methods are "readonly". For more on the DHTML classes, start
here.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
PLBlum
All-Star
30399 Points
5347 Posts
MVP
Changing settings on the browser from the server
Jan 07, 2004 09:16 PM|LINK
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com