Best way to add DOM elements with jQuery

后端 未结 7 1063
南笙
南笙 2020-12-05 02:08

So I\'ve seen three ways to add html/DOM elements to a page. I\'m curious what the pros and cons are for each of them.

1 - Traditional JavaScript

7条回答
  •  悲哀的现实
    2020-12-05 02:27

    If you're working with large amounts of HTML you want to reuse then I'd suggest you look at: http://api.jquery.com/jQuery.template/ which is final, but will be replaced by something better.

    I use it in a production environment and it's great, as for smaller pieces of html what sp. said is the best way

提交回复
热议问题