To avoid conflicts with other javascript libraries that also use $ .
This method, however, allows you to use $ in this function as you wish, no need to use jQuery there.
This pattern is also important when writing jquery plugins.
Sarfraz
source share