javascript / document.title question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Renfrew

    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>Docume nt Title &nbsp;&nbsp;&nb sp;&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


  • McKirahan

    #2
    Re: javascript / document.title question

    "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
    news:8hg0e.7980 $JK1.527498@new s20.bellglobal. com...[color=blue]
    > Essentially, I want to prevent the display of the Microsoft Internet
    > Explorer or any other branding tag in the document title. One technique[/color]
    that[color=blue]
    > I've used is to insert multiple spaces after the desired title to push the
    > tag off of the screen.
    >
    > (i.e. <title>Docume nt Title &nbsp;&nbsp;&nb sp;&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[/color]


    Will this help?

    <html>
    <head>
    <title>titles.h tm</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.


    Comment

    • Ian Renfrew

      #3
      Re: javascript / document.title question

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

      Regards, Ian

      "McKirahan" <News@McKirahan .com> wrote in message
      news:6_OdnSkOas OVANzfRVn-iA@comcast.com. ..[color=blue]
      > "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
      > news:8hg0e.7980 $JK1.527498@new s20.bellglobal. com...[color=green]
      >> Essentially, I want to prevent the display of the Microsoft Internet
      >> Explorer or any other branding tag in the document title. One technique[/color]
      > that[color=green]
      >> I've used is to insert multiple spaces after the desired title to push
      >> the
      >> tag off of the screen.
      >>
      >> (i.e. <title>Docume nt Title &nbsp;&nbsp;&nb sp;&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[/color]
      >
      >
      > Will this help?
      >
      > <html>
      > <head>
      > <title>titles.h tm</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.
      >
      >[/color]


      Comment

      • Ian Renfrew

        #4
        Re: javascript / document.title question

        The closest that I can come is:

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

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

        Regards, Ian

        "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
        news:8hg0e.7980 $JK1.527498@new s20.bellglobal. com...[color=blue]
        > 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>Docume nt Title &nbsp;&nbsp;&nb sp;&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
        >
        >[/color]


        Comment

        • McKirahan

          #5
          Re: javascript / document.title question

          "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
          news:KVi0e.8040 $JK1.546528@new s20.bellglobal. com...[color=blue]
          > The closest that I can come is:
          >
          > var documentTitle = "DOCUMENT TITLE";
          > for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
          > document.write( "<title>"+docum entTitle+"</title>");
          >
          > If someone has a better solution, I'd like to know.
          >
          > Regards, Ian[/color]

          [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?


          Comment

          • Ian Renfrew

            #6
            Re: javascript / document.title question

            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" <News@McKirahan .com> wrote in message
            news:Kb2dnTmUta vGd9zfRVn-sA@comcast.com. ..[color=blue]
            > "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
            > news:KVi0e.8040 $JK1.546528@new s20.bellglobal. com...[color=green]
            >> The closest that I can come is:
            >>
            >> var documentTitle = "DOCUMENT TITLE";
            >> for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
            >> document.write( "<title>"+docum entTitle+"</title>");
            >>
            >> If someone has a better solution, I'd like to know.
            >>
            >> Regards, Ian[/color]
            >
            > [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?
            >
            >[/color]


            Comment

            • McKirahan

              #7
              Re: javascript / document.title question

              "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
              news:WMn0e.3590 0$nK.1098447@ne ws20.bellglobal .com...[color=blue]
              > 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[/color]
              now.[color=blue]
              >
              > ... Ian[/color]

              [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.h tm</title>
              <script type="text/javascript">
              var documentTitle = "DOCUMENT TITLE";
              for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
              document.write( "<title>"+docum entTitle+"</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;&nbs p;&nbsp;&nbsp;& nbsp;&nbsp;&nbs p;&nbsp;&nbsp;& nbsp;&nbsp;&nbs p
              ;&nbsp;&nb - Microsoft Internet Explorer p

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

              DOCUMENT TITLE
              &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb s
              p;&nbsp;&nbsp;& nbsp;&nbsp;&nbs p;&nbsp;&nbsp;& nbsp;&nb

              (which filled up the entire Title Bar)


              Comment

              • Ian Renfrew

                #8
                Re: javascript / document.title question

                Remove the line:

                <title>titlex.h tm</title>

                All works fine with IE6 and Firefox

                .... Ian

                "McKirahan" <News@McKirahan .com> wrote in message
                news:BYadnZMZL4 Pojd_fRVn-pw@comcast.com. ..[color=blue]
                > "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
                > news:WMn0e.3590 0$nK.1098447@ne ws20.bellglobal .com...[color=green]
                >> 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[/color]
                > now.[color=green]
                >>
                >> ... Ian[/color]
                >
                > [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.h tm</title>
                > <script type="text/javascript">
                > var documentTitle = "DOCUMENT TITLE";
                > for (var i=0; i<300; i++) { documentTitle += "&nbsp;"; }
                > document.write( "<title>"+docum entTitle+"</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;&nbs p;&nbsp;&nbsp;& nbsp;&nbsp;&nbs p;&nbsp;&nbsp;& nbsp;&nbsp;&nbs p
                > ;&nbsp;&nb - Microsoft Internet Explorer p
                >
                > Under FF1.0 I saw (one one line):
                >
                > DOCUMENT TITLE
                > &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb s
                > p;&nbsp;&nbsp;& nbsp;&nbsp;&nbs p;&nbsp;&nbsp;& nbsp;&nb
                >
                > (which filled up the entire Title Bar)
                >
                >[/color]


                Comment

                • Matthew Lock

                  #9
                  Re: javascript / document.title question

                  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.

                  Comment

                  • McKirahan

                    #10
                    Re: javascript / document.title question

                    "Ian Renfrew" <ian_renfrew@sy mpatico.ca> wrote in message
                    news:JNr0e.3643 9$nK.1202970@ne ws20.bellglobal .com...[color=blue]
                    > Remove the line:
                    >
                    > <title>titlex.h tm</title>
                    >
                    > All works fine with IE6 and Firefox
                    >
                    > ... Ian[/color]

                    [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.


                    Comment

                    Working...