Skip to content

Instantly share code, notes, and snippets.

@toamitkumar
Created March 30, 2012 01:57
Show Gist options
  • Save toamitkumar/2245739 to your computer and use it in GitHub Desktop.
Save toamitkumar/2245739 to your computer and use it in GitHub Desktop.
ashutoshdikshit
Day 1
Form.html
Excellent. Inline CSS and JS is bad practice. Always create files and include them.
Day 2:
Tweets.html
1.
Inline CSS and JS is bad practice. Always create files and include them.
2.
Hooking inline js to html elements is bad practice. Its always good to follow "Unobtrusive JS" approach. It is clear separation of html from javascript code. MVC on the front-end tier.
Read more on this -> http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
3.
$('<li>'+data[i].text+'</li>').appendTo("#list");
# This will add "li" to the DOM inside loop. Not good for performance.
# Its better to build a string inside a loop and add the whole string to the DOM outside of loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment