www.webdeveloper.com
Results 1 to 5 of 5

Thread: javascript for detecting System then redirecting to sys-specific page

  1. #1
    Join Date
    Sep 2010
    Posts
    6

    javascript for detecting System then redirecting to sys-specific page

    I post video on the web for personal sites and for clients. Still to date there is no viable cross platform video codec, Windows STILL does not support Flash, and Mac doesn't support WHM.

    I use Fancybox to display video, using the iframe function in fancybox to get a page with the video embedded.

    I would like a javascript detector I can install in the head of the page that is loaded into the iframe which will detect the system of the user's computer, for inst: if Windows then do nothing, if Mac then redirect to a different page to load, so that I can load Flash only for Mac machines, and WHM only for Windows machines. Is this possible, and what would that javascript be?

    If not poss. for iframe loading (don't know why it wouldn't be), then I'd like a script to do that function for a normal html page.
    thanks
    JSC
    Last edited by jami1955; 03-13-2011 at 05:03 AM. Reason: forgot something

  2. #2
    Join Date
    Oct 2003
    Location
    Andover, UK
    Posts
    946
    navigator.appVersion returns system info.

  3. #3
    Join Date
    Sep 2010
    Posts
    6
    Yes it does. It doesn't do anything about redirecting tho, would I need to visit a freelance website to find that?

    (I would like a javascript detector I can install in the head of the page that is loaded into the iframe which will detect the system of the user's computer, for inst: if Windows then do nothing, if Mac then redirect to a different page to load, so that I can load Flash only for Mac machines, and WHM only for Windows machines. . .)

  4. #4
    Join Date
    Oct 2003
    Location
    Andover, UK
    Posts
    946
    Something like:

    Code:
    if (navigator.appVersion.indexOf('Macintosh') != -1) location.href = 'somepage.html';

  5. #5
    Join Date
    Sep 2010
    Posts
    6
    thanks for that, cheers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
HTML5 Development Center



Recent Articles