SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirect for Browsers with JS turned off???

    Does any one know of a way to redirect someone with JavaScript disables to another page (or would we need a little JS to accomplish this?)

    I'm putting together a site that uses a horizontal javascript drop down navbar, and thought it would be coolness to redirect those that either cannot read js, or have js turned off to my site map page.
    Last edited by Rockrz; Oct 29, 2002 at 09:47.
    .

  2. #2
    SitePoint Wizard Rick's Avatar
    Join Date
    Oct 2002
    Location
    Lancashire, UK
    Posts
    3,847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you using PHP then you could use
    PHP Code:
    headerLocationhttp://www.your-site-here.tld ); 
    to send users regardless of thier browsers Javascripting ability, you'd need to get non-JS users to the PHP script though - but you could use a PHP browser detection script to decide where to send them or something.

    This is the wrong forum to explain that though, if that sounds good try posting in the PHP forum, someone will no dount be around to help, and I can give you a few pointers on the subject.

    Also the standard meta-refresh tag seems to do the trick for most (common) browsers, you may have noticed it used around SP Forums on the redirect pages. The code is:
    Code:
    <meta http-equiv="Refresh" content="1; URL=you-page-here.html">
    I think that will work for non-JS browsers.

    Good luck with the site

    Rick
    Last edited by zoo; Oct 29, 2002 at 11:02.
    Rick

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you should approach it from the other way. Have a page without the javascript dropdown bar that has the javascript to redirect them to the one that has it. If they don't have javascript turned on or the browser does not support it then it won't redirect. If they do then it will. You could place this script in the head section:
    <SCRIPT LANGUAGE="JavasScript">
    location.href="page_with_navbar.html"
    </SCRIPT>

    That will redirect them right away if they have javascript turned on.

  4. #4
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tips . . .

    I'm not so sure I would want a redirect script on my front page as it might affect my "search engine friendliness"

    I've already put a link under where my navbar sits that says "If you see no Navbar, CLICK HERE for our site map".

    I wouldn't want to do anything at all to affect search engine rankings. This is the main reason why I've not spent much time learning to do database driven sites, because I hear there's all kinds of problems with getting listed high in search engines.

    I know there are ways around that, but I don't have the time to learn a bunch of new things just to accomodate this problem.

    I've had very good success getting high rankings with using a straight forward html approach.

    Maybe I'll just stick with what I've got for now.
    Thanks again for the tips!
    .

  5. #5
    SitePoint Wizard Rick's Avatar
    Join Date
    Oct 2002
    Location
    Lancashire, UK
    Posts
    3,847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tips : No problem

    Good luck with your site

    Rick
    Rick

  6. #6
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks....

    My business is starting to really take off & that's why I'm running out of time to continue doing websites.

    I'm just doing them for my business now.
    I've got about 6 or 7 sites planned.
    I'll finish someday!
    .


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
  •