$( '<div>' ) is the way to go.
- Trevor
On Mon, Aug 27, 2012 at 4:37 PM, Mark Holmquist mtraceur@member.fsf.orgwrote:
Hence, I think we should change our coding conventions to always use `$(
'<div />' )`.
+1 for valid XHTML. Considering that bytes are cheap and validity is good, this seems like a good idea.
I also tried to get an answer about the better between $( '<div class="a-class" />' ) and $( '<div />' ).addClass( 'a-class' ), but apparently there's little difference. At least when creating dynamic interfaces, I'd like to have some guidance and consistency if anyone is interested in chatting about it.
My preference is the latter, because it avoids extensive HTML inside of JavaScript. But I'd be interested to hear other thoughts.
-- Mark Holmquist Contractor, Wikimedia Foundation mtraceur@member.fsf.org http://marktraceur.info
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l