Forums

[resolved] Conditional check for Javascript? (3 posts)

  1. tictok
    Member
    Posted 1 year ago #

    Does anyone know of anyway within coding a template that I could check to see if a visitors browser has javascript enabled or not and then run a conditional statement based on this?

    There are a few areas of a site I'm building (using WP as a CMS) which rely on javascript and would appear broken or incorrect with JS disabled in the browser.

    I want to find a way to offer visitors without JS a couple of alternative pages that will look and work okay without JS.

    So, in a nutshell, I guess I'm asking wether;
    A) Is it possible to check to see if a visitors browser has JS enabled?
    if so;
    B) Use the outcome of the JS check to conditionally show one page or another
    (i.e. if user has JS enabled get template-file-A.php else if user does not have JS get template-file-B.php)

    hope someone can help!
    Many thanks
    Stef

  2. coopersita
    Member
    Posted 1 year ago #

    I posted a possible solution in your old thread: http://wordpress.org/support/topic/417120

  3. tictok
    Member
    Posted 1 year ago #

    Thanks -

    yep if you're following this thread go here:-

    http://wordpress.org/support/topic/417120

    cheers
    S

Topic Closed

This topic has been closed to new replies.

About this Topic