Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-02-2005, 12:08 PM   PM User | #1
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
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?
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Last edited by Kor; 02-02-2005 at 12:19 PM..
Kor is offline   Reply With Quote
Old 02-02-2005, 01:00 PM   PM User | #2
codegoboom
Regular Coder

 
Join Date: Aug 2004
Location: codegoboom@yahoo.com
Posts: 999
Thanks: 0
Thanked 0 Times in 0 Posts
codegoboom is an unknown quantity at this point
Internet Explorer

BUG: Script Fails to Change the Document Title of a Web Page
__________________
*this message will self destruct in n-seconds*
codegoboom is offline   Reply With Quote
Old 02-02-2005, 01:35 PM   PM User | #3
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
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
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:28 PM.


Advertisement
Log in to turn off these ads.