SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    object detection vs. browser detection

    Hi,

    I'm going to make an attempt at coding a nice tree menu that is decent with browser support.

    I want the tree to be displayed on all browsers (well, within a decent range). Of course, on older browsers, the menu won't be as functional.

    Now, I'm going to be combining the javascript with a server-side language (asp.NET) and I'll be able to do some basic browser detection on the server.

    But, I read about javascript object detection and am wondering how well that works exactly.

    Like, what if a browser that doesn't support objects period tries to run some object detection code? Also, which browsers support user defined objects?

    See, I'm thinking of breaking down the script in 3 categories. Browsers that won't get any javascript... these would be the browsers that don't support object detection, browsers with basic javascript... with these I would be able to code my own object and I would test for different features. And then there would be the browsers that can run it all.

    So, basically, my question is what browsers support what features and how should I break down my code between them? A long time ago (back in the Netscape 4 / IE4 days) I did some javascripting, but since then I haven't really done any. I remember that NS4 didn't support div tags but supported layers... anyway, it got really messy.

    I need to figure out some way to encorporate all browsers decently. So, I need somewhere to start.

    thanks,
    carl
    Ohai!

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any browser with javascript support will have DOM0 -- so object detection is never an issue.

    Object detection is definitely the way to go. I can think of only a few instances where browser detection is the preferred choice.

    If you want cross browser capacity - either pick a development API (ie www.crossbrowser.com) or make a few function to abstract common processes (such as retrieving node references).

    I typically will object-test just prior to using that object in the code -- that will allow for steps of degradability.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so, does every single javascript enabled browser allow me to write my own objects too? I'm sorry, I don't know what DOM0 is. I've heard of DOM although i'm no master of it. I really am going to need to brush up on my js skills.
    Ohai!

  4. #4
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I read up on DOM0... so you don't need to bother with that question
    Ohai!

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, Microsoft JScript (Microsoft's ECMAscript implementation) included the Object constructor in version 3.0. JScript 3.0 was implemented in Internet Explorer 4.0 [Reference]

    Javascript (Netscape's ECMAscript implementation) included the Object constructor in verision 1.0. Javascript 1.0 is in every non-IE JS-capable browser (that I know of) [Reference]
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •