I was looking over the jQuery to better understand how it works. The constructor basically just calls
new jQuery.fn.init
I was wondering what is the point of having the init inside jQuery's prototype? Wouldn't defining init()
as part of the jQuery object itself serve the same purpose?
Basically I would like to know why jQuery's init function is located at jQuery.fn.init()
and not jQuery.init()
Are there people doing this:
jQuery('a').eq(0).hide().init('div').slideToggle(); //?