Results 1 to 5 of 5

Thread: Redirecting if JS is off

  1. #1
    Join Date
    Jun 2008
    Posts
    40
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default Redirecting if JS is off

    Hey all,

    Does anyone know if there is an effective way to redirect is JS is off? I was thinking of something like

    Code:
    <noscript>
    <meta http-equiv="refresh" content="0; URL=http://www.mydoman.com/jsOff.php">
    </noscript>
    However, I was told by someone I should avoid meta refreshes and use PHP. I'm not sure how a server side code is supposed to make a client side reaction. Thoughts?

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    If you want to do it with PHP then the code for it is:

    PHP Code:
    <?php header("Location: http://www.yoursite.com/page.html"); ?>
    But doing a meta refresh is fine so far as I know.

  3. #3
    Join Date
    Jun 2008
    Posts
    40
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    Quote Originally Posted by Schmoopy View Post
    If you want to do it with PHP then the code for it is:

    PHP Code:
    <?php header("Location: http://www.yoursite.com/page.html"); ?>
    But doing a meta refresh is fine so far as I know.

    Right, but that wouldn't actually check for JS or not.

  4. #4
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    But you could just leave it all to PHP, with there not being a need to check for JS, since PHP will work with or without it.

  5. #5
    Join Date
    Jun 2008
    Posts
    40
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    Quote Originally Posted by Schmoopy View Post
    But you could just leave it all to PHP, with there not being a need to check for JS, since PHP will work with or without it.
    Well, my concern is not to redirect, but to redirect if JS is off.

Bookmarks

Posting Permissions

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