Skip to content Skip to sidebar Skip to footer

What Does This Jquery Function Mean?

I am trying to understand how a js library works, more specifically http://toopay.github.io/bootstrap-markdown/. The whole js file is wrapped in this function: !function ($) { }(wi

Solution 1:

It creates a function then immediately calls it. The reason it does that is just so all the variables it makes won't be global, as they'll be inside the function instead. The ! is just to avoid causing problems when it's concatenated with other scripts and to save space.

You can't call it yourself, nor should you.

Post a Comment for "What Does This Jquery Function Mean?"