By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,219 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,219 IT Pros & Developers. It's quick & easy.

javascript / document.title question

P: n/a
Essentially, I want to prevent the display of the Microsoft Internet
Explorer or any other branding tag in the document title. One technique that
I've used is to insert multiple spaces after the desired title to push the
tag off of the screen.

(i.e. <title>Document Title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>)

I want to write some javascript to perform the same operation. How would
this be written using javascript?

Thanks in advance, Ian Renfrew
Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:8h*******************@news20.bellglobal.com.. .
Essentially, I want to prevent the display of the Microsoft Internet
Explorer or any other branding tag in the document title. One technique that I've used is to insert multiple spaces after the desired title to push the
tag off of the screen.

(i.e. <title>Document Title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>)

I want to write some javascript to perform the same operation. How would
this be written using javascript?

Thanks in advance, Ian Renfrew

Will this help?

<html>
<head>
<title>titles.htm</title>
<script type="text/javascript">
function titles() {
var what = "";
for (var i=0; i<44; i++) {
what += " .";
}
document.title += what;
window.status = document.title.length;
}
</script>
</head>
<body onload="titles()">
</body>
</html>

However, it look like changing I above ~44 won't change it anymore.
Jul 23 '05 #2

P: n/a
Almost, unfortunately this just adds dots (44) after the title. I was hoping
for whitespaces to avoid clutter and improve clarity.

Regards, Ian

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:6_********************@comcast.com...
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:8h*******************@news20.bellglobal.com.. .
Essentially, I want to prevent the display of the Microsoft Internet
Explorer or any other branding tag in the document title. One technique

that
I've used is to insert multiple spaces after the desired title to push
the
tag off of the screen.

(i.e. <title>Document Title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>)

I want to write some javascript to perform the same operation. How would
this be written using javascript?

Thanks in advance, Ian Renfrew

Will this help?

<html>
<head>
<title>titles.htm</title>
<script type="text/javascript">
function titles() {
var what = "";
for (var i=0; i<44; i++) {
what += " .";
}
document.title += what;
window.status = document.title.length;
}
</script>
</head>
<body onload="titles()">
</body>
</html>

However, it look like changing I above ~44 won't change it anymore.

Jul 23 '05 #3

P: n/a
The closest that I can come is:

var documentTitle = "DOCUMENT TITLE";
for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
document.write("<title>"+documentTitle+"</title>");

If someone has a better solution, I'd like to know.

Regards, Ian

"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:8h*******************@news20.bellglobal.com.. .
Essentially, I want to prevent the display of the Microsoft Internet
Explorer or any other branding tag in the document title. One technique
that I've used is to insert multiple spaces after the desired title to
push the tag off of the screen.

(i.e. <title>Document Title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>)

I want to write some javascript to perform the same operation. How would
this be written using javascript?

Thanks in advance, Ian Renfrew

Jul 23 '05 #4

P: n/a
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:KV*******************@news20.bellglobal.com.. .
The closest that I can come is:

var documentTitle = "DOCUMENT TITLE";
for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
document.write("<title>"+documentTitle+"</title>");

If someone has a better solution, I'd like to know.

Regards, Ian


[snip]

Anything that worked would be better.

1) You can't change the title via "document.write()".

2) "&nbsp;" in the title show up as-is not as a space.

3) The title may have a limit of about 100 characters.

BTW, did you actually try your own code?
Jul 23 '05 #5

P: n/a
Yes I did. The work around code produces the desired result.

(i.e. Instead of seeing 'DOCUMENT TITLE - Microsoft Internet Explorer' in
the title, I now see 'DOCUMENT TITLE ...'.)
I was hoping for a more elegant solution, but this will have to do for now.

.... Ian

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Kb********************@comcast.com...
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:KV*******************@news20.bellglobal.com.. .
The closest that I can come is:

var documentTitle = "DOCUMENT TITLE";
for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
document.write("<title>"+documentTitle+"</title>");

If someone has a better solution, I'd like to know.

Regards, Ian


[snip]

Anything that worked would be better.

1) You can't change the title via "document.write()".

2) "&nbsp;" in the title show up as-is not as a space.

3) The title may have a limit of about 100 characters.

BTW, did you actually try your own code?

Jul 23 '05 #6

P: n/a
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:WM********************@news20.bellglobal.com. ..
Yes I did. The work around code produces the desired result.

(i.e. Instead of seeing 'DOCUMENT TITLE - Microsoft Internet Explorer' in
the title, I now see 'DOCUMENT TITLE ...'.)
I was hoping for a more elegant solution, but this will have to do for now.
... Ian


[snip]

I tested it under IE5.5, FF1.0 and NS6.2 and saw no change to the title in
the Title Bar at the top of the browser.

Here's the code I used:

<html>
<head>
<title>titlex.htm</title>
<script type="text/javascript">
var documentTitle = "DOCUMENT TITLE";
for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
document.write("<title>"+documentTitle+"</title>");
</script>
</head>
<body>
</body>
</html>

When I changed the last line to:
document.title = documentTitle;

Under NS6.2 I saw no change.

Under IE5.5 I saw (one one line):

DOCUMENT
TITLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nb - Microsoft Internet Explorer p

Under FF1.0 I saw (one one line):

DOCUMENT TITLE
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nb

(which filled up the entire Title Bar)
Jul 23 '05 #7

P: n/a
Remove the line:

<title>titlex.htm</title>

All works fine with IE6 and Firefox

.... Ian

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:BY********************@comcast.com...
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:WM********************@news20.bellglobal.com. ..
Yes I did. The work around code produces the desired result.

(i.e. Instead of seeing 'DOCUMENT TITLE - Microsoft Internet Explorer' in
the title, I now see 'DOCUMENT TITLE ...'.)
I was hoping for a more elegant solution, but this will have to do for

now.

... Ian


[snip]

I tested it under IE5.5, FF1.0 and NS6.2 and saw no change to the title in
the Title Bar at the top of the browser.

Here's the code I used:

<html>
<head>
<title>titlex.htm</title>
<script type="text/javascript">
var documentTitle = "DOCUMENT TITLE";
for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
document.write("<title>"+documentTitle+"</title>");
</script>
</head>
<body>
</body>
</html>

When I changed the last line to:
document.title = documentTitle;

Under NS6.2 I saw no change.

Under IE5.5 I saw (one one line):

DOCUMENT
TITLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nb - Microsoft Internet Explorer p

Under FF1.0 I saw (one one line):

DOCUMENT TITLE
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nb

(which filled up the entire Title Bar)

Jul 23 '05 #8

P: n/a
Why would you want to remove the Browser's branding title from the
browser? I hope it's not a spoofing attempt to make a browser window
look like a system window.

Jul 23 '05 #9

P: n/a
"Ian Renfrew" <ia*********@sympatico.ca> wrote in message
news:JN********************@news20.bellglobal.com. ..
Remove the line:

<title>titlex.htm</title>

All works fine with IE6 and Firefox

... Ian


[snip]

I took out the title tags and:

Under FF1.0 it works.

Under IE5.5 it clears about 4.5 inches.

Under NS6.2 it doesn't work; I saw: Netscape 6.
Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.