Karma/Anti-conventions: Difference between revisions
Created page with 'Not closing <img /> or <meta /> tags. You can usually get away with not closing these tags but they could cause weird rendering of elements that follow them. If you don't close…' |
No edit summary |
||
| Line 2: | Line 2: | ||
You can usually get away with not closing these tags but they could cause weird rendering of elements that follow them. If you don't close <img>, the browser might think that any following elements are childrent rather than siblings and display them accordingly. | You can usually get away with not closing these tags but they could cause weird rendering of elements that follow them. If you don't close <img>, the browser might think that any following elements are childrent rather than siblings and display them accordingly. | ||
<nowiki> | |||
Using document.write('<div> some html </div>'); instead of $('#parentDiv').html('<div> some html </div>'); | Using document.write('<div>some html</div>'); instead of $('#parentDiv').html('<div> some html </div>'); | ||
</nowiki> | |||
document.write is just bad in general. Some browsers don't like it (chromium) and in all browsers it freezes all other execution while it is writing to the page. | document.write is just bad in general. Some browsers don't like it (chromium) and in all browsers it freezes all other execution while it is writing to the page. | ||