javascript availibility

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

    javascript availibility

    Hello,

    I would like to check a user turn on or off the javascript option in
    their web brower.

    RWC
  • Steven Dilley

    #2
    Re: javascript availibility

    "reneeccwes t" <reneeccwest@ho tmail.com> wrote in message
    news:9f9d6d21.0 308070941.6a73e b95@posting.goo gle.com...[color=blue]
    > Hello,
    >
    > I would like to check a user turn on or off the javascript option in
    > their web brower.
    >
    > RWC[/color]

    <div id="noScripts" > Scripting is disabled </div>
    <script type="text/javascript">
    document.getEle mentById("noScr ipts").style.di splay="none";
    </script>
    <noscript>In fact, your browser is so old it does not even know what a
    script is!</noscript>

    Obviously, there is nothing you can do with this info:
    you can't run a script to detect that scripts are disabled.
    That is, you can not have "if (scriptsDisable d) {...}"

    --Steve

    Comment

    • Grant Wagner

      #3
      Re: javascript availibility

      Steven Dilley wrote:
      [color=blue]
      > "reneeccwes t" <reneeccwest@ho tmail.com> wrote in message
      > news:9f9d6d21.0 308070941.6a73e b95@posting.goo gle.com...[color=green]
      > > Hello,
      > >
      > > I would like to check a user turn on or off the javascript option in
      > > their web brower.
      > >
      > > RWC[/color]
      >
      > <div id="noScripts" > Scripting is disabled </div>
      > <script type="text/javascript">
      > document.getEle mentById("noScr ipts").style.di splay="none";
      > </script>[/color]

      The code above would tell me that IE 4 & 5, Netscape 4.x and Opera 6.x all
      have scripting disabled when that may not be true.
      [color=blue]
      > <noscript>In fact, your browser is so old it does not even know what a
      > script is!</noscript>
      >
      > Obviously, there is nothing you can do with this info:
      > you can't run a script to detect that scripts are disabled.
      > That is, you can not have "if (scriptsDisable d) {...}"[/color]

      Something like the following is usually recommended:

      <head>
      <script type="text/javascript">
      window.location .href = 'jsEnabledPage. html';
      // or window.location .replace('jsEna bledPage.html') ;
      </script>
      </head>
      <body>
      Scripting is disabled
      </body>

      --
      | Grant Wagner <gwagner@agrico reunited.com>

      * Client-side Javascript and Netscape 4 DOM Reference available at:
      *


      * Internet Explorer DOM Reference available at:
      *
      Gain technical skills through documentation and training, earn certifications and connect with the community


      * Netscape 6/7 DOM Reference available at:
      * http://www.mozilla.org/docs/dom/domref/
      * Tips for upgrading JavaScript for Netscape 7 / Mozilla
      * http://www.mozilla.org/docs/web-deve...upgrade_2.html


      Comment

      Working...