brianleroux / xui

A tiny javascript framework for mobile web apps.
http://github.com/xui/xui
391 stars 159 forks source link

Propose to ditch newly added xui('<img />'); #23

Closed remy closed 14 years ago

remy commented 14 years ago

I've reviewed the code that filmaj checked in to create elements and (could possibly do with tuning, along with killing the global vars being created - tsk!) although it does what is says on the tin, I think it's going to create problems. Here's why:

It looks to replicate the functionality of other libraries, such as jQuery, when you pass the HTML to generate the markup on the fly, except it kinda doesn't.

xui('<img />') does the same as jQuery('<img />');

But - misleadingly:

xui('<img /><strong>bold</strong>') does NOT do the same as jQuery('<img /><strong>bold</strong>');

Instead XUI gives us a single <img> element inside the collection, rather than the <img> and <strong> with text set to bold.

/me fixing.

remy commented 14 years ago

Fixed here - we can now pass arbitrary HTML to XUI:

http://github.com/brianleroux/xui/commit/9597a42ab0c81cab9314071a66cb0094825b8f35