Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    Question Modify dinamically <title> data

    I am to modify the <title> in about 100 pages. The Head section of each page is in fact a sigle php include. Unfortunately I have to have different titles for groups of pages.

    I tryed to change dinamilically the <title> using:

    document.documentElement.getElementsByTagName('title')[0].data;
    or
    document.documentElement.getElementsByTagName('title')[0].appendChild(document.createTextNode('test'));
    or
    document.documentElement.getElementsByTagName('title')[0].innerHTML

    with no effect

    The assignement is located inside the body. Nomatter it is a simple assignment or called onload in afunction, it looks like the head's tag can not be changed dinamically. Any suggestion?
    Last edited by Kor; 02-02-2005 at 01:19 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *this message will self destruct in n-seconds*

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Yes, thanx. I solved the problem by returning to the old DOM 1 Level document.title wich is working ok either in IE6 and Moz, which is enough for my client. I have noticed that DOM2 Level methods are not working upon TITLE tag... hm.. could be a bug or rather a sort of security enclusure, I don't know
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •