In this video there is a snippet of code that goes something like this:
if (jQuery) {jQuery(function() {
// ...
})}
I’ve never seen the jQuery() function before (then again, I’m not a savvy jQuery user), what does it do? Does it ship by default with jQuery or is it specific to IxEdit? Since the usual $(window).load() snippet is missing and the code is somewhat similar I’m guessing it’s a shortcut / alias to:
$(window).load(function() {
// ...
)}
Am I right? Also what is that jQuery variable? What does it hold? And why is he checking it?
$() is an alias for jQuery(), defined as:
http://code.jquery.com/jquery-1.4.js
there is a special case defined when $() or jQuery() is called with the first argument being a function:
sometimes $ can conflict with other libraries (like prototype) that define the same function, so if you call
it will remove the $ alias, setting it back to the original value found, essentially: