Header & Footer

This is a discussion on Header & Footer within the Tech Board forums, part of the Community Boards category; Sorry for asking this here... Is it possible to change the default header and footer of an internet explorer page ...

  1. #1
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765

    Header & Footer

    Sorry for asking this here...

    Is it possible to change the default header and footer of an internet explorer page with javascript?
    The knack of flying is learning to throw yourself at the ground and miss.

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    Depends on what you mean. If this is your website, you could definately have divs defined that you could hide or show that would change an are of the page. If you want to do this the easy way, you should consider a server-side language like PHP and use includes.

    Maybe it would be better if you defined what you're trying to accomplish?

  3. #3
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    I have an electronic form. Now when you print it, it usually gives you the normal header and footer "http:///......" and so forth.

    I want to change that default header & footer wioth javascript.

    We use a website built woth CGI, but we don't have the source to it.

    So I'm basicly only allowd to use javascript
    The knack of flying is learning to throw yourself at the ground and miss.

  4. #4
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    >>Now when you print it, it usually gives you the normal header and footer "http:///......" and so forth.

    I don't get what you mean by this. Are you talking about the actual HTTP headers, or something that is printing out on the printer? If you want to change the address that is printed out on the bottom of the page, forget it. That's browser controlled and you can't change it.

  5. #5
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    I don't get what you mean by this. Are you talking about the actual HTTP headers, or something that is printing out on the printer? If you want to change the address that is printed out on the bottom of the page, forget it. That's browser controlled and you can't change it.
    Yup, that's what I want to do...
    The knack of flying is learning to throw yourself at the ground and miss.

  6. #6
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    You can't. That is a function of the browser and its output to the printer, which you cannot control from Javascript. If you want this functionality, you have to write your own browser and make all your users use it.

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You should be able to change the header using the <title> tag:
    Code:
    <Title>My Home Page</Title>
    This is normally printed somewhere on the page.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    I think he cared more about the footer than the header, but yes, that's true.

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>I think he cared more about the footer than the header, but yes, that's true.
    Turn the paper upside down. < just a thought >
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  10. #10
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    I think he cared more about the footer than the header, but yes
    True yes, the footer is the most important, but i' wll also need to change the header...
    The knack of flying is learning to throw yourself at the ground and miss.

  11. #11
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    Well, as I said before, you cannot change the footer unless you redirect them to a URL that you like better than what is being spit out to the printer.

  12. #12
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Well... then I guess thats that then
    The knack of flying is learning to throw yourself at the ground and miss.

  13. #13
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    It Can be Done!

    File->Page Setup allows you to change the header & footer.

    You can do this programatically, but it's pretty hardcore! - http://support.microsoft.com/default...b;en-us;267240

  14. #14
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    File->Page Setup allows you to change the header & footer
    Must be done with coding.


    Had a look at the code, It's quite hectic....

    But the thing is, I must do it with javascript or something...
    The knack of flying is learning to throw yourself at the ground and miss.

  15. #15
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    You might be able to get a reference to the IWebBrowser2 interface in JScript (In IE, Javascript is JScript) and call ExecWB on that...but from what I've seen on other boards that doesnt work.

    You could port the code I gave you to an activeX dll and call that in JScript, but this would trigger a security prompt and the dll would need to be registered on each PC that used your page.

    Lastly you could suss out the registry settings that IE reads to get the default Header & Footer and change them, but again youd need an activeX component to read the registry from JScript and youd run into security problems again.

    So basically...with Javascript...not very likely!

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Obtaining source & destination IP,details of ICMP Header & each of field of it ???
    By cromologic in forum Networking/Device Communication
    Replies: 1
    Last Post: 04-29-2006, 02:49 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21