Connecting Tech Pros Worldwide Forums | Help | Site Map

Change title

Masao Kishore
Guest
 
Posts: n/a
#1: Jul 20 '05
How do you change the title within <title> and </title> by JS?
Thank you for your help.
M.K.


JimMenees
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Change title


the displayed document title can be changed with:
document.title="your title here"
Masao Kishore
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Change title


Thank you for your help but the following does not work:
<HTML>
<HEAD>
<title>ABC</title>
<SCRIPT LANGUAGE=JavaScript>
function start() {
document.title("XYZ");
}
</SCRIPT>
</HEAD>
<BODY onload="start()">
</BODY>
</HTML>

"JimMenees" <jimmenees@aol.comNoSpam> wrote in message
news:20031123201227.16444.00000600@mb-m23.aol.com...[color=blue]
> the displayed document title can be changed with:
> document.title="your title here"[/color]


Fabian
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Change title


Masao Kishore hu kiteb:
[color=blue]
> Thank you for your help but the following does not work:
> <HTML>
> <HEAD>
> <title>ABC</title>
> <SCRIPT LANGUAGE=JavaScript>
> function start() {
> document.title("XYZ");[/color]
[color=blue][color=green]
>> document.title="your title here"[/color][/color]

Spot the difference.


--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Michael Winter
Guest
 
Posts: n/a
#5: Jul 20 '05

re: Change title


Masao Kishore wrote on 24 Nov 2003:
[color=blue]
> Thank you for your help but the following does not work:
> <HTML>
> <HEAD>
> <title>ABC</title>
> <SCRIPT LANGUAGE=JavaScript>[/color]

That should read:

<SCRIPT type="text/javascript">

The type attribute is mandatory and is all you really need.
[color=blue]
> function start() {
> document.title("XYZ");[/color]

<snip>

document.title is a property, not a method. You assign to it - you
don't call it.

Mike

--
Michael Winter
M.Winter@blueyonder.co.uk.invalid (remove ".invalid" to reply)
nice.guy.nige
Guest
 
Posts: n/a
#6: Jul 20 '05

re: Change title


While the city slept, Masao Kishore <on@request.com> feverishly typed:
[color=blue]
> How do you change the title within <title> and </title> by JS?
> Thank you for your help.[/color]

As the others have said, document.title="blah". Bear in mind, though, that
NN4 treats the document title as read-only, and will not let you change it.
Then again, NN4 is an abberation and the sooner it is no longer used, we can
all breath a sigh of relief ;-)

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. nigel@nigenetDOG.org.uk. Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
In the land of the blind, the one-eyed man is very, very busy!


Closed Thread


Similar JavaScript / Ajax / DHTML bytes