Results 1 to 6 of 6

Thread: JavaScript detection

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    JavaScript detection



    "I work at a major financial services company," writes Seth. "We have a public site that requires JavaScript be enabled. When it's not, the visitor is redirected to an error page that explains the website's requirements."

    Definitively determining whether someone has JavaScript turned on or not can be a pretty challenging task, but fortunately, Seth's colleagues developed a bulletproof method to figure this out. They used JavaScript.

    function javascriptEnabled(){
    return true;
    }

    Clearly, if that function is successfully called, then JavaScript must be enabled. Like the isComputerOn() method that was (allegedly) part of the BeOS API, if it doesn't return true, then clearly, it's off. So, by applying this logic later on in the code, Seth's colleagues came up with this:

    function validateSettings(){

    if(!javascriptEnabled()){
    location.href="no_js.htm";
    }
    ...
    }

    Seth added, "To their credit... err, I think... they said that they didn't realize JavaScript could be disabled in their browser. They tested it by having javascriptEnabled return false."

    http://thedaily***.com/Articles/Bull...Detection.aspx

  2. #2
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: JavaScript detection

    What's the problem? Some kind of formatting issue?

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: JavaScript detection

    Who needs JS when you have LOLCode
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: JavaScript detection

    Quote Originally Posted by visualAd View Post
    Who needs JS when you have LOLCode
    Code:
    troof iCanHasTehLolCodezEnabled()
    {
      kthanksbai(jajaja);
    }
    I don't live here any more.

  5. #5

  6. #6
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: JavaScript detection


Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width