473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

javascript / document.title question

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
9 2340
"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
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
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
"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
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
"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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: annoyingmouse2002 | last post by:
Hi there, sorry if this a long post but I'm really just starting out. I've been using MSXML to parse an OWL but would like to use a different solution. Basically it reads the OWL (Based on XML)...
2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
10
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load...
16
by: datactrl | last post by:
Hi, Is that posible to create a web page completely with javascript and open it without request to server? Please show a simple sample. Thanks in advance! Jack
3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
7
by: e | last post by:
I've been having an extremely difficult time finding an answer to this in IE / js groups, so I thought I'd try here. I've got an aspx page that delivers loads of report data into custom-named...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
3
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.