Results 1 to 3 of 3

Thread: Turning JavaScript off

  1. #1

    Turning JavaScript off

    Is there anyway to detect whether someone has turned Javascript in their browser off?
    now with blog, click here

  2. #2
    602
    posts
    Backend Specialist
    Well...you could detect whether it is on or not by using <noscript> (this has some issues with its use I think...you could have a page that redirects them with javascript and one that uses a meta refresh tag also...

    example:
    Code:
    <head>
    <script type="text/javascript">
      <!--
        window.location = "mypage.php?js=1" ;
      // -->
    </script>
    <meta http-equiv="refresh" content="2; URL=mypage.php?js=0">
    </head>
    hth,

  3. #3
    You could use noscript, or you can use this code

    Code:
    <script language="JavaScript">
    <!-- Hide
    function onoff () {
    document.write("You have javascript on!")}
    End -->
    </script>
     
    <CENTER>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
       onoff() 
    -->
    </SCRIPT>
    </CENTER>
    or if you want to display a message to a user that does not have it on then use this

    Code:
    <script language="JavaScript">
    <!-- Hide
    document.write("Hello")
    End -->
    </script>
    <noscript>
    Mwhaahhah, turn javascript on idiot
    <noscript>
    Last edited by GPP; March 13th, 2006 at 12:05 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012