I just downloaded the free jQuery Succinctly e-book for free ( here ) from Syncfusion and started looking at examples.
I see a lot of this type of thing:
<script> (function ($)
{
$('a').mouseenter(
function () { alert(this.id); });
})(jQuery);
</script>
I am not sure why the author uses this syntax. $Is the object passed into an anonymous function? What for? What is (jQuery)an anonymous function?
Is this just a way to avoid conflicts with other libraries? It seems to me that these examples could be written much "concisely" :)
Thank.
source
share