1.Difference
between body.onload() function and document.ready() function used in
jQuery
2.Difference
between jquery.size() and jquery.length
-
S.No body.onload() document.ready() 1 We can have only one onload functionWe can have more than one document.ready() function in a page2 body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.document.ready() function is called as soon as DOM is loaded
-
S.Nojquery.size()jquery.length
1 jquery.size() is slower thanjquery.lengthjquery.length is faster thanjquery.size()2 size() is a methodlength is a property
Summary:
jquery.size()
and jquery.length both returns the number of element found in the
object.
jquery.size() is slower than jquery.length as there is always an
overhead in
calling
a function
No comments:
Post a Comment