javascript - Why do we use the dollar window and document method for binding? -
this question has answer here:
- jquery , iife wrapper clarification? 1 answer
why use this?
(function( $, window, document, undefined ) { ....... })(( jquery, window, document );)
i think $ converted jquery, ok! why window, document?
and also, can use own selector method this?
var mydiv = $('#mydiv'); (function( $, window, document, mydiv, undefined ) { ....... })(( jquery, window, document, mydiv );)
to make locally scoped reference window , document. provides performance benefit.
Comments
Post a Comment