So, one thing we thing we can learn from these sites that its all depend on the way we are writing our code. There are so many documents stating about the best uses of java script. Some of them I will write below.
- In normal practice when we include a javascript file we do it in the header element of our page.
- But best practices says you do it in your last part of your page.
- Try to load your javascript file asynchronously. (I will give some examples in my next post)
- If you have an advantage of using javascript libraries like dojo/jquery/yui, then use their function which are similar to window.onLoad. (e.g. dojo.aaddOnload())
- Try to use object oriented concept in javascript. Some links are given below.
http://www.javapassion.com/ajax/JavaScriptBestPractices.pdf
http://nefariousdesigns.co.uk/archive/2006/05/object-oriented-javascript/
Please go through the links & share your thoughts. Because its us who will make some difference.
Please share your knowledge...
Thanks in advance...
No comments:
Post a Comment