I have two questions:
It may be foolish questions but I really want some keywords to explain them.
Thanks
One way that JQuery gives the impression of redefining the language is with the $ operator. What may not be clear however is that $ is just a function declared at window (global) scope, since $ is a valid variable name in JavaScript:
From the source:
jQuery = window.jQuery = window.$ = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
They are not extending the syntax of javascript per say. They still have to abide by all the grammar rules of javascript.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With