Open
Description
Too many people are making the exact same mistakes and re-implementing the same anti-patterns. Borrow from fixingthesejquery.com and expand into articles so that these traps are well-documented canonically.
Some things that instantly leap to mind (let's expand this list) are:
- Injecting malformed HTML in IE (never works)
- Using HTML strings instead of actual manipulation methods to move things around the DOM (A lot of people who ask for an
outerHTML
solution need it because they're trying to do$("#bar").append( $("#foo").outerHTML() )
instead of the more practical$("#bar").append( $("#foo").clone() )
(or$("#foo").clone().appendTo("#bar")
) (pretending for a second here that dupliateIDs are not a problem)... which leads me to... - Duplicate IDs