SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: javascript off

Hybrid View

  1. #1
    SitePoint Evangelist jkh1978's Avatar
    Join Date
    May 2001
    Location
    Northern Virginia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript off

    I just made a cool site with javascript... but forgot that the menus will not work if the javascript is turned off. Is there a way to show an alternative page if the javascript is off?

  2. #2
    SitePoint Enthusiast Atrus's Avatar
    Join Date
    Aug 2001
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ... not directly.

    First thing, I'd do is introducing <noscript> tags that represent the links from the menus.

    Right now I can't think of a way of redirecting non-script users to a different page but the other way should work. Does your site have one of these initial splash pages? You could redirect after 5 seconds to a non-script page using the http-equiv 'refresh' tag. At the same time you run a JS function that redirects via setting window.location.href to a site featuring menus after 3(!) seconds. The JS function, naturally, will only run, when a user has JS enabled.


    Also you can show links below the splash image in case the redirecting should fail or be disabled. Place the non-script link within <noscript> tags. The JS user won't see it and won't get confused.
    Place the script-enabled link within <script><!-- document.writeln(" ...link ... "; --></script> tags and this is only for the eyes of the JS enables user.

    Have fun!

    Atrus.
    Webmaster - Stefan Meier KG TABAKWAREN - Pfeifen, Premium-Zigarren, ... (_Ger)


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
  •