How is it that jQuery can do $(\"#foo\").addClass(\"bar\") and $.ajax()?
I\'m creating a micro javascript framework and want to create a new in
Two different things:
$.ajax is a prototyped function of jQuery called ajax.
While $('foo') is a call of the jQuery function and depending on the type of foo it reacts in different ways. At http://api.jquery.com/jQuery you can see that jQuery (almost the same as $) can react on three different types: selectors, html or callbacks.