Javascript enabled ?

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

    Javascript enabled ?

    Hi,

    Is it possible to check if the javascript is turn on on the browser (IE,
    firefox, ...)?


    Thanks,


    Christian,


  • Hywel Jenkins

    #2
    Re: Javascript enabled ?

    In article <41d19071$0$318 $ba620e4c@news. skynet.be>, ml@cista.be says...[color=blue]
    > Hi,
    >
    > Is it possible to check if the javascript is turn on on the browser (IE,
    > firefox, ...)?[/color]

    Yes. Try executing some JS in your web page. If it runs, JS is
    enabled. If it doesn't, it isn't.

    --
    Hywel http://kibo.org.uk/
    I do not eat quiche.

    Comment

    • McKirahan

      #3
      Re: Javascript enabled ?

      "Christian Ista" <ml@cista.be> wrote in message
      news:41d19071$0 $318$ba620e4c@n ews.skynet.be.. .[color=blue]
      > Hi,
      >
      > Is it possible to check if the javascript is turn on on the browser (IE,
      > firefox, ...)?
      >
      >
      > Thanks,
      >
      >
      > Christian,[/color]

      Here's one way. Watch for word-wrap.

      <html>
      <head>
      <title>jsenable d.htm</title>
      <script type="text/javascript">
      function js() {
      document.getEle mentById("JS"). innerHTML = "JavaScript is enabled!"
      }
      </script>
      </head>
      <body onload="js()">
      <span id="JS">JavaScr ipt is not enabled!</span>
      </body>
      </html>

      I doubt that it's cross-browser compatible -- we'll probably hear from
      others!


      Comment

      • Evertjan.

        #4
        Re: Javascript enabled ?

        McKirahan wrote on 28 dec 2004 in comp.lang.javas cript:[color=blue]
        > "Christian Ista" <ml@cista.be> wrote in message[color=green]
        >> Is it possible to check if the javascript is turn on on the browser
        >> (IE, firefox, ...)?[/color]
        > Here's one way. Watch for word-wrap.
        >
        > <html>
        > <head>
        > <title>jsenable d.htm</title>
        > <script type="text/javascript">
        > function js() {
        > document.getEle mentById("JS"). innerHTML = "JavaScript is enabled!"
        >}
        > </script>
        > </head>
        > <body onload="js()">
        > <span id="JS">JavaScr ipt is not enabled!</span>
        > </body>
        > </html>[/color]

        <html>
        <head>
        <title>jsNOTena bled.html</title>
        <script type="text/javascript">
        location.href = '/jsenabled.html'
        </script>
        </head>
        <body>
        JS NOT enabled
        </body>
        </html>


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

        Comment

        • Randy Webb

          #5
          Re: Javascript enabled ?

          McKirahan wrote:[color=blue]
          > "Christian Ista" <ml@cista.be> wrote in message
          > news:41d19071$0 $318$ba620e4c@n ews.skynet.be.. .
          >[color=green]
          >>Hi,
          >>
          >>Is it possible to check if the javascript is turn on on the browser (IE,
          >>firefox, ...)?
          >>
          >>
          >>Thanks,
          >>
          >>
          >>Christian,[/color]
          >
          >
          > Here's one way. Watch for word-wrap.
          >
          > <html>
          > <head>
          > <title>jsenable d.htm</title>
          > <script type="text/javascript">
          > function js() {
          > document.getEle mentById("JS"). innerHTML = "JavaScript is enabled!"[/color]

          = "Javascript is enabled, your browser supports getElementById and it
          supports innerHTML. Doesn't mean a lot though."

          --
          Randy
          comp.lang.javas cript FAQ - http://jibbering.com/faq

          Comment

          • Dr John Stockton

            #6
            Re: Javascript enabled ?

            JRS: In article <41d19071$0$318 $ba620e4c@news. skynet.be>, dated Tue, 28
            Dec 2004 17:57:21, seen in news:comp.lang. javascript, Christian Ista
            <ml@cista.be> posted :[color=blue]
            >
            >Is it possible to check if the javascript is turn on on the browser (IE,
            >firefox, ...)?[/color]

            You should first ask yourself how the information might be used; or, if
            you know, explain your intent.

            ISTM perfectly possible (untested) to do something like

            <script type="text/VBScript"> dim JSisON : JSisON=false </script>

            <script type="text/javascript"> JSisON=true </script>

            <script type="text/VBScript">
            document.write " JS is ON is ", JSisON </script>

            but rather unusual.

            Otherwise, what you ask is not entirely unlike asking what the result of
            your own last round of Russian Roulette was.



            One possibility is to put on the first page, presumably at the top,

            <script type="text/javascript"> location.href = "XX.htm" </script>

            Page XX.htm will be reached when javascript is enabled; otherwise, the
            first page remains scriptlessly active.

            --
            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
            <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
            <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
            <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

            Comment

            Working...