Friday, April 15, 2011

Document.ready() vs Onload ()

Document.ready() onload()
JqueryNormal JS function
calls as soon as DOM id loadedcalls when everything gets loaded on the page that includes DOM, images and all associated resources of the page
We can have as many as
document.ready()
onload function is limited on one time
Fasterslow compared to .ready()


What is jQuery and what are its Features/Advantages?

 jQuery is a very good JavaScript Library that runs in browser. Its is client side ajax framework. It is used to develop web 2.0 . The jQuery library is designed to keep the things very simple and reusable. jQuery library simplifies the process of traversal of HTML DOM tree. You can use jQuery to handle events, perform animation, and add the ajax support into your web applications with ease.



The following are important features of jQuery.


  1. Light weight only few js area supposed to include to use the functionality.
  2. Easy to learn. With in days , any one can become the master of the JQuery.
  3. Extensibility The jQuery Framework is easily extensible.
  4. DOM elements manipulations It easily handles DOM element selections functions, manipulations, traversal and modification.
  5. Event Handling We can implement Event Handling at client side.
  6. CSS manipulation It provides the flexibility for CSS manipulation. We can apply or change CSS dynamically using jQuery.
  7. Animations Advanced effects and animations are possible using jQuery.
  8. Cross Browser Compatibility It is Consistent across all browsers.
  9. Easy Plugins Number of plug-in or widgets available to achieve certain functionality like paging, sorting, drag, accordion etc