0

From what I have learned, jquery syntax is the following $(selector).action(). However I found that in some cases the selector is not included. For example, $.ajax or $.widget. What does this mean exactly? When, where, and how should we use this kind of syntax instead of using selector?

Thanks a lot :)

  • So you're either missing a jQuery plugin or you are using jQuery.slim which doesn't come with $.ajax. Anyone can extend jQuery, but it will complain when you try to refer to an extension and it is missing. – Win Oct 14 '21 at 20:35
  • It is a property on the object. Basic idea: `function foo(){ console.log('here'); } foo.bar = function () { console.log('there'); }; foo(); foo.bar();` – epascarello Oct 14 '21 at 20:38

0 Answers0