Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Mar 2003
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Browser Redirect

    This is what I use to detect what browser the user is using, and opening up a page that is designed for that specific browser:

    <SCRIPT LANGUAGE="JavaScript">

    var name = navigator.appName
    if (name == "Microsoft Internet Explorer")
    window.open('index.htm','Max','width=795, height=440, toolbar=no, status=no, scrollbars=no, top=1, left=1, resize=no')

    else

    window.open('nets/index.htm','Max','width=800, height=440, toolbar=no, status=no, scrollbars=no, top=1, left=1, resize=no')

    </SCRIPT>

    Of course, the window size and attributes can be adjusted to your own needs!

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course, you could also just write cross-browser code, and not worry about it.

  • #3
    New Coder
    Join Date
    Mar 2003
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, i've always wondered about that, but it's hard to do that. Any tips on cross browser coding? I have trouble with tables and frames when I try to code for both major browsers.

  • #4
    New Coder
    Join Date
    Feb 2003
    Location
    Oregon, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you tried XHTML. That is what it is designed for.

    Nick
    If you want to be the best, you have to work harder than the best.

  • #5
    New Coder
    Join Date
    Mar 2003
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    XHTML...any suggestions on where to start learning XHTML?

  • #6
    New Coder
    Join Date
    Feb 2003
    Location
    Oregon, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The quickest way is to pick up a book. I use XHTML Black Book from Coriolis. It seems to cover just about everything.

    XHTML is really not that much different than HTML. It is just a more strict format. It does let get to a few more advanced features too. The book lets you know which commands work in IE compared to NS, etc. But to actually be XHTML the commands need to work in all browsers.

    Most of the differences are minor stuff, for example:

    You can use:

    <img src="buttons/forms aqua - btn.gif" border=0 width=150 height=27>

    And it would work in most browsers, but to be XHTML it should be:

    <img src="buttons/forms aqua - btn.gif" alt="" name="p25" border="0" width="150"
    height="27" />

    Differences, you must include the NAME, you must include an ALT pic, all values must be in quotes, and you must terminate the statement (with a /).

    It sounds like a pain in the butt, but once you get it down it makes your code a lot cleaner and a lot more coss compatible.

    XHTML is not perfect either though. There are still some things that don't work in all browsers. This is just part of the vendor wars and you have to find a work around.

    Did that help, or did I get to wordy?

    Nick
    If you want to be the best, you have to work harder than the best.

  • #7
    New Coder
    Join Date
    Mar 2003
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks! I pretty well got it, but I don't understand how this can make it more cross browser compatible? I always use quotes anyway, and alt tags....???

  • #8
    New Coder
    Join Date
    Feb 2003
    Location
    Oregon, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ahhhh...you are one of the good peoples... I do like it when people have clean code.

    A book that covers XHTML will show you how to do things with code that works in (supposedly) all browsers. It's not some huge revelation, it's just the way to get things done and have it work for everyone.

    Nick
    If you want to be the best, you have to work harder than the best.

  • #9
    New Coder
    Join Date
    Feb 2003
    Location
    Oregon, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After all....XHTML means extended HTML....
    If you want to be the best, you have to work harder than the best.


  •  

    Posting Permissions

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