XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
better (?) than DOM

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS