$( '<div>' ) is the way to go.

- Trevor

On Mon, Aug 27, 2012 at 4:37 PM, Mark Holmquist <[email protected]>wrote:

> 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
> [email protected]
> http://marktraceur.info
>
> ______________________________**_________________
> Wikitech-l mailing list
> [email protected]
> https://lists.wikimedia.org/**mailman/listinfo/wikitech-l<https://lists.wikimedia.org/mailman/listinfo/wikitech-l>
>
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to