javascript - Why do we use the dollar window and document method for binding? -


this question has answer here:

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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -