473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

which DOM level to use?

YAD
How do you decide which DOM level you should use? I've been told level 2
is the "modern" approach, but also saw a website that said use level 0
any time you can.

Should you use higher-level code where lower-level code works? Does
lower-level code fail in modern browsers? What are the issues you have
to worry about?

--
Yet another Dan
Aug 11 '06 #1
4 1452
YAD wrote:
How do you decide which DOM level you should use? I've been told level 2
is the "modern" approach, but also saw a website that said use level 0
any time you can.
DOM 0 is just the stuff that both Navigator and IE supported when DOM 1
was introduced. It is possible (though not yet likely) that new
browsers will start to drop support for DOM 0 since it isn't in any W3C
standard.

Should you use higher-level code where lower-level code works? Does
lower-level code fail in modern browsers? What are the issues you have
to worry about?
Use DOM 2 with feature detection and fallback. Use DOM 0 only where:

- you know there is an issue with the implementation of a
particular DOM 2 feature in a browser you need to support
(for the web that's all of them)
- DOM 0 proivdes a more widely supported alternative, and
- there is no easy test to use for fallback

For example, IE's issue with using createElement for option elements -
it's easier to just use new Option.
--
Rob

Aug 11 '06 #2
YAD wrote:
How do you decide which DOM level you should use?
That question is maningless.
I've been told level 2 is the "modern" approach, but also
saw a website that said use level 0 any time you can.
Generally, if any single feature of any DOM (or pre-DOM/non-DOM) can be
verified to be available and functioning correctly it can be used. Some
(but not all) of the features of what it called DOM Level 0 as so
universal that they could be assumed to be available without
verification, using those features then becomes advantageous as it
avoids the need to test for them.
Should you use higher-level code where lower-level code
works?
If you can verify that the higher level DOM features are available and
function correctly.
Does lower-level code fail in modern browsers?
No and yes.
What are the issues you have to worry about?
Designing the whole system so that there are sensible outcomes following
the verification of the unavailability of features required by scripts.

Richard.

Aug 11 '06 #3
Richard Cornford wrote:
YAD wrote:
>How do you decide which DOM level you should use?

That question is maningless.
<snip>

And that would make more sense if it was "meaningless".

Richard.
Aug 11 '06 #4
YAD
Richard Cornford wrote:
YAD wrote:
>How do you decide which DOM level you should use?
That question is maningless.
And that would make more sense if it was "meaningless".
It would make even more sense if you would explain why or how
it's meaningless. If you decide to use a DOM-2 feature in a web
page, aren't you using DOM-2? What's meaningless about that?

Also, what about DOM-1 vs. DOM-2?
I'm asking the general question about how you decide
what features to use, not just level 0 and level 2.
Do essentially all browsers support DOM-1 these days?
Is it much safer than DOM-2?
>What are the issues you have to worry about?
Designing the whole system so that there are sensible outcomes following
the verification of the unavailability of features required by scripts.
But more specifically, suppose you can write the whole page without
DOM-2 features. Is there any reason you should use DOM-2 anyway
just because it's more up-to-date? Or should it be avoided except
where lower levels don't provide the functionality you need?
How aggressive should you be about moving away from lower DOM levels?
--
Yet another Dan
Aug 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
7
by: Murtix Van Basten | last post by:
Hi all, I will deploy a database project to an Oracle server, but I could not figure out which version of Oracle should I get. Here is my configuration: Hardware: Dell 1750 Dual Xeon 3.2Ghz,...
4
by: Robert Oschler | last post by:
I have a comparison web page that has several iframes that contain documents from external domain web sites. Some of the web sites are "trusted". If they want to change the top level document...
4
by: Robert | last post by:
Hi, which DOM version (level) should I learn? I've seen that there is a DOM level 3, but is there any support for it already? -- Rob
17
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
4
by: savvy | last post by:
I'm developing a Garment Shopping Cart. On the Admin side, while inserting the each Product details, the user has to choose options of Colour Icons and Sizes for each Garment. All the colour icons...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
3
by: d d | last post by:
I have a large object with many sub-objects. They may go down 4 or 5 levels and I'm not sure how best to code a method that does operations on that data. Here's an attempt to make it an isolated...
20
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.