[Home] [By Thread] [By Date] [Recent Entries]

  • From: Robin Berjon <robin@j...>
  • To: Nathan Young -X ((natyoung - Artizen at Cisco)) <natyoung@c...>
  • Date: Fri, 23 Feb 2007 12:51:19 +0100

On Feb 22, 2007, at 18:45, Nathan Young -X ((natyoung - Artizen at  
Cisco)) wrote:
> I'll repost with a little explanation because I'm curious if anyone  
> has seen something like this.  Absent XML4J it's not completely  
> crazy to create violent shortcuts for creating nodes  
> programmatically.  Although it is chained method calls, it comes  
> remarkably close to looking like a markup language:
>
> jQuery('#myDiv').append(
>     jQuery.DIV({'class':'big'},
>         jQuery.SPAN({id:'one','class':'ps'},
>             'Hello Joe', jQuery.I({},'!')
>         )
>     )
> );

Maybe it's just me but even though I've been doing Javascript quite a  
fair bit and for a long time, I don't find the above particularly  
attractive. It seems to be begging for E4X, which is IMHO a lot  
clearer than the above.

--
Robin Berjon
........................................................................
"Let us think the unthinkable, let us do the undoable. Let us prepare
  to grapple with the ineffable itself, and see if we may not eff it
  after all."
             -- Dirk Gently (Douglas Adams)




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member