Closed Thread
Results 1 to 3 of 3

Thread: Help detecting browser

  1. #1
    TurboSRT4 is offline Newbie
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Help detecting browser

    Hello all.... I am a rookie programer and I am learning javascript as needed I am fairly good with perl....my site will only work correctly with IE. Is there a way with javascript to detect browser and if its not ie to use a confirm box to redirect and open a new window with my site in IE thank

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Nov 2009
    Posts
    10
    Rep Power
    0

    Re: Help detecting browser

    You can use javascript's navigator object to get the browser info.

    Code:
    var browser=navigator.appName;
    or
    var userAgent = navigator.userAgent;
    then check it against known browser names to see which one the client is using.
    You can find more info about the navigator object in (www).w3schools.com/js/js_browser.asp) and (www).javascriptkit.com/javatutors/navigator.shtml)

    However as for your second question (force the user to open a new window in IE) I don't believe its possible.

    if you want my opinion you should try to make your site cross browser compatible.

  4. #3
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Help detecting browser

    I would strongly discourage you from requiring IE for your site. It is slowly losing market share, and people who are using Macs or Linux cannot run it. Since most javascript can be made cross-browser compatible, why not do that instead?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 02-20-2011, 04:18 PM
  2. detecting a Cookie in HTML
    By code2learn in forum HTML Programming
    Replies: 0
    Last Post: 01-01-2011, 08:39 AM
  3. C - Detecting no user input
    By skybox in forum C and C++
    Replies: 4
    Last Post: 09-20-2010, 01:12 PM
  4. Detecting a spacebar keystroke in CMD
    By TheSourceOfX in forum C and C++
    Replies: 4
    Last Post: 09-06-2010, 12:35 AM
  5. Not detecting my memory?
    By racerman in forum Linux Hardware
    Replies: 5
    Last Post: 02-26-2009, 07:30 AM

Tags for this Thread

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