window.status Javascript

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

    window.status Javascript

    hey guys,

    i have been searching around... and it seems that the below code is
    good for a SINGLE PAGE.

    <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something ';return
    true">


    but... i have TONS of pages, and instead of going to each page and
    adding this code, i was wondering if the above code could be done in a
    javascript that i can put in my HEAD... such as <SCRIPT> ....</SCRIPT>

    in my hundreds of pages, I have them pointing to one page that has a
    list of scripts.... and would like to add that script here.
  • Fabian

    #2
    Re: window.status Javascript

    Steve hu kiteb:
    [color=blue]
    > hey guys,
    >
    > i have been searching around... and it seems that the below code is
    > good for a SINGLE PAGE.
    >
    > <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something ';return
    > true">
    >
    >
    > but... i have TONS of pages, and instead of going to each page and
    > adding this code, i was wondering if the above code could be done in a
    > javascript that i can put in my HEAD... such as <SCRIPT> ....</SCRIPT>
    >
    > in my hundreds of pages, I have them pointing to one page that has a
    > list of scripts.... and would like to add that script here.[/color]

    This kind of thing can be done in javascript, but would be done far more
    efficiently in a style sheet.


    --
    --
    Fabian
    Visit my website often and for long periods!


    Comment

    • Evertjan.

      #3
      Re: window.status Javascript

      Steve wrote on 15 nov 2003 in comp.lang.javas cript:
      [color=blue]
      > i have been searching around... and it seems that the below code is
      > good for a SINGLE PAGE.
      >
      > <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something ';return
      > true">[/color]

      The return true has no purpose, methinks.
      [color=blue]
      >
      > but... i have TONS of pages, and instead of going to each page and
      > adding this code, i was wondering if the above code could be done in a
      > javascript that i can put in my HEAD... such as <SCRIPT> ....</SCRIPT>
      >[/color]

      While you can do this:

      <SCRIPT>
      document.body.o nclick=function (){window.statu s='something'}
      </SCRIPT>

      you have to write it AFTER the <body> declaration.

      =============== ==============

      why not simply do this in the header:

      <SCRIPT>
      window.status=' something else'
      </SCRIPT>

      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)

      Comment

      • Michael Winter

        #4
        Re: window.status Javascript


        "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
        news:Xns9434A74 0E4155eejj99@19 4.109.133.29...[color=blue]
        > Steve wrote on 15 nov 2003 in comp.lang.javas cript:
        >[color=green]
        > > i have been searching around... and it seems that the below code[/color][/color]
        is[color=blue][color=green]
        > > good for a SINGLE PAGE.
        > >
        > > <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something[/color][/color]
        ';return[color=blue][color=green]
        > > true">[/color]
        >
        > The return true has no purpose, methinks.
        >[color=green]
        > >
        > > but... i have TONS of pages, and instead of going to each page and
        > > adding this code, i was wondering if the above code could be done[/color][/color]
        in a[color=blue][color=green]
        > > javascript that i can put in my HEAD... such as <SCRIPT>[/color][/color]
        .....</SCRIPT>[color=blue][color=green]
        > >[/color]
        >
        > While you can do this:
        >
        > <SCRIPT>
        > document.body.o nclick=function (){window.statu s='something'}
        > </SCRIPT>
        >
        > you have to write it AFTER the <body> declaration.
        >
        > =============== ==============
        >
        > why not simply do this in the header:
        >
        > <SCRIPT>
        > window.status=' something else'
        > </SCRIPT>
        >
        > --
        > Evertjan.
        > The Netherlands.
        > (Please change the x'es to dots in my emailaddress)[/color]


        Comment

        • Michael Winter

          #5
          Re: window.status Javascript

          [Apologies for my previous, pointless post]

          "Evertjan." wrote on 15/11/2003:
          [color=blue]
          > Steve wrote on 15 nov 2003 in comp.lang.javas cript:
          >[color=green]
          > > i have been searching around... and it seems that the below code[/color][/color]
          is[color=blue][color=green]
          > > good for a SINGLE PAGE.
          > >
          > > <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something[/color][/color]
          ';return[color=blue][color=green]
          > > true">[/color]
          >
          > The return true has no purpose, methinks.[/color]

          Although this might be out-of-date, it is worth noting for
          compatibility's sake. From Netscape's "Client-Side JavaScript
          Reference", version 1.3 (1999):

          "You can set the status property at any time. You must return true if
          you want to set the status property in the onMouseOver event handler."
          Description of the window.status property.

          Mike

          --
          Michael Winter
          M.Winter@[no-spam]blueyonder.co.u k (remove [no-spam] to reply)


          Comment

          • Evertjan.

            #6
            Re: window.status Javascript

            Michael Winter wrote on 15 nov 2003 in comp.lang.javas cript:[color=blue]
            > "You can set the status property at any time. You must return true if
            > you want to set the status property in the onMouseOver event handler."
            > Description of the window.status property.[/color]

            This would in practice only be important if you
            do a <a onmouseover=...
            because a false return disables the href executuion
            (even then at least IE defaults to true)


            --
            Evertjan.
            The Netherlands.
            (Please change the x'es to dots in my emailaddress)

            Comment

            • Steve

              #7
              Re: window.status Javascript

              <SCRIPT>
              window.status=' something else'
              </SCRIPT>

              the above script does not work...
              if there is no javascript that does this... can anyone tell me how to
              do it in css sheet?

              steve


              "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message news:<Xns9434B0 F14552Feejj99@1 94.109.133.29>. ..[color=blue]
              > Michael Winter wrote on 15 nov 2003 in comp.lang.javas cript:[color=green]
              > > "You can set the status property at any time. You must return true if
              > > you want to set the status property in the onMouseOver event handler."
              > > Description of the window.status property.[/color]
              >
              > This would in practice only be important if you
              > do a <a onmouseover=...
              > because a false return disables the href executuion
              > (even then at least IE defaults to true)[/color]

              Comment

              • Lasse Reichstein Nielsen

                #8
                Re: window.status Javascript

                steve@lo-fimedia.com (Steve) writes:
                [color=blue]
                > <SCRIPT>
                > window.status=' something else'
                > </SCRIPT>
                >
                > the above script does not work...[/color]

                It does for me.
                That is, you have not given sufficient information for us to do anything
                about your problem.

                These all work for me:

                ---
                <script type="text/javascript">
                window.status=" foo";
                </script>
                <img src="../../PicA.png"
                onmouseover="wi ndow.status='ba r';return true;"
                onmouseout="win dow.status='';r eturn true;">
                <input type="button" value="set baz!" onclick="window .status='baz';" >
                ---

                Tested in IE6, Moz FB and Opera 7.
                [color=blue]
                > if there is no javascript that does this... can anyone tell me how to
                > do it in css sheet?[/color]

                It can't be done with CSS.

                /L
                --
                Lasse Reichstein Nielsen - lrn@hotpop.com
                DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                'Faith without judgement merely degrades the spirit divine.'

                Comment

                • Steve

                  #9
                  Re: window.status Javascript

                  okay...

                  as stated earlier.. i have about 300 pages. all pages go to this ONE
                  page where i just list all my javascripts (so i only need to modify
                  one page). this one page is has no body, no text, just a collection of
                  script i use throughout the whole site.

                  rather than going to each page and adding a script in the body or the
                  link, i want a <SCRIPT> that i can just add in my ONE page. this
                  means that this script can not use <BODY> tags... or <IMAGE> tags...
                  just a script in my one page to make it so no one can view the urls of
                  my files.

                  does this help? and is this possible?

                  Comment

                  • Evertjan.

                    #10
                    Re: window.status Javascript

                    Steve wrote on 18 nov 2003 in comp.lang.javas cript:[color=blue]
                    > <SCRIPT>
                    > window.status=' something else'
                    > </SCRIPT>
                    >
                    > the above script does not work...
                    >[/color]

                    It does here on IE6


                    --
                    Evertjan.
                    The Netherlands.
                    (Please change the x'es to dots in my emailaddress)

                    Comment

                    • Lasse Reichstein Nielsen

                      #11
                      Re: window.status Javascript

                      steve@lo-fimedia.com (Steve) writes:
                      [color=blue]
                      > as stated earlier.. i have about 300 pages. all pages go to this ONE
                      > page where i just list all my javascripts (so i only need to modify
                      > one page). this one page is has no body, no text, just a collection of
                      > script i use throughout the whole site.[/color]

                      So, you include a big JS-*file* in all your pages, and you do so in
                      the head element. It is not a page, just a file (I hope :).

                      Do the pages have a body.onload handler? If you want to centralize the
                      code, it would be smart if all 300 pages had
                      <body onload="init()" >
                      and then the init function would set up the things that can't be handled
                      while the page is still being loaded.
                      [color=blue]
                      > rather than going to each page and adding a script in the body or the
                      > link, i want a <SCRIPT> that i can just add in my ONE page. this
                      > means that this script can not use <BODY> tags... or <IMAGE> tags...[/color]

                      This sucks, and there isn't a lot you can do about it. If your code
                      must run while the head element is being loaded, then it can't access
                      the body element. In order for it to run later, you must provide some
                      sort of hook.
                      [color=blue]
                      > just a script in my one page to make it so no one can view the urls of
                      > my files.[/color]

                      Why on earth do you think you need that. The URL is still there, and there
                      are lots of ways to find it. However, hiding it from the statusbar has only
                      one use: To annoy the users (and will fail in some browsers, no matter what
                      you do).
                      [color=blue]
                      > does this help? and is this possible?[/color]

                      Yes. Probably not. You can use setTimeout to delay execution of some
                      code until the body element is perhaps loaded. Or even use setInterval
                      to keep trying until it is. But it will never be pretty.

                      /L
                      --
                      Lasse Reichstein Nielsen - lrn@hotpop.com
                      DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                      'Faith without judgement merely degrades the spirit divine.'

                      Comment

                      • Thomas 'PointedEars' Lahn

                        #12
                        Re: window.status Javascript

                        Fabian wrote:
                        [color=blue]
                        > Steve hu kiteb:[color=green]
                        >> <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something ';return
                        >> true">
                        >>
                        >>
                        >> but... i have TONS of pages, and instead of going to each page and
                        >> adding this code, i was wondering if the above code could be done in a
                        >> javascript that i can put in my HEAD... such as <SCRIPT> ....</SCRIPT>
                        >>
                        >> in my hundreds of pages, I have them pointing to one page that has a
                        >> list of scripts.... and would like to add that script here.[/color]
                        >
                        > This kind of thing can be done in javascript, but would be done far more
                        > efficiently in a style sheet.[/color]

                        Unlikely. It is the status bar the OP wants to manipulate and
                        I have never heard of a (proprietary) CSS property that does that.


                        PointedEars

                        Comment

                        • Thomas 'PointedEars' Lahn

                          #13
                          Re: window.status Javascript

                          Steve wrote:
                          [color=blue]
                          > <BODY BGCOLOR=white onMouseOver="wi ndow.status=' something ';return
                          > true">
                          >
                          >
                          > but... i have TONS of pages, and instead of going to each page and
                          > adding this code, i was wondering if the above code could be done in a
                          > javascript that i can put in my HEAD... such as <SCRIPT> ....</SCRIPT>
                          >
                          > in my hundreds of pages, I have them pointing to one page that has a
                          > list of scripts.... and would like to add that script here.[/color]

                          The issue of including a script library containing the code aside,
                          you want to leave the status bar as is because it is *my* status
                          bar, a useful tool, and not your playground nor that of any other
                          scriptkiddie. Recent UAs have means to block JavaScript access to
                          the status bar, too.


                          PointedEars

                          Comment

                          Working...