xil3 xil3 - 1 year ago 121
Javascript Question

Dollar sign before self declaring anonymous function in JavaScript?

What is the difference between these two:

$(function () {
// do stuff


(function () {
// do stuff

Answer Source

The first uses jQuery to bind a function to the document.ready event. The second declares and immediately executes a function.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download