[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
better (?) than DOM
- From: "Nathan Young -X \(natyoung - Artizen at Cisco\)" <natyoung@cisco.com>
- To: "XML Developers List" <xml-dev@lists.xml.org>
- Date: Wed, 21 Feb 2007 16:02:40 -0800
Hi.
After getting up to speed with some of the new javascript user interface
libraries that are out there, I connected some of what they are doing
with a thread that's come up on this list from time to time. The
perennial topic is "DOM programming is broken/clunky/doesn't fit task X
well and should be replaced/enhanced/etc"
I see a bunch of library code that's reinventing DOM programming, in
other words it's adding helper functions that go way beyond native DOM
functions like getElementById(), appendChild(), etc.
Note that these libraries are trying to answer the question "better than
DOM programming" for a very specific use, namely creating client side
user interfaces in the web browser.
I'm not aware of any crosstalk between JS library creators and anyone
who may be working on formal enhancements to DOM. I think over the next
year or so these libraries are going to consolidate and some good ideas
will float to the top.
This is jQuery code that defines click functions that animate a bunch of
elements (and the animation triggers a callback as well):
$(".collapse_group[a]").click( function () {
$(this).parent().siblings("tr").slideToggle("fast", function() {
$(this).each( function() {
if ($(this).css("display") ==
"block")
$(this).css("display",
"");
});
});
});
This is a long way from pure DOM programming and it goes deep in
javascript only territory. Parts of it though are pure shortcut across
multiple DOM calls.
Here's some more code from a jQuery plugin that eases (you may or may
not agree) creation and insertion of DOM elements into a web page:
$('#myDiv').append(
$.DIV({'class':'big'},
$.SPAN({id:'one','class':'ps'},
'Hello Joe', $.I({},'!')
)
)
);
.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:
||:.
Nathan Young
Cisco.com->Interface Development
A: ncy1717
E: natyoung@cisco.com
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]