What does the leading semicolon in a javascript file mean? -


this question has answer here:

i have file jquery.flex.js starts with

enter image description here

what beginning mean?

the purpose of semicolon avoid error if file concatenated one.

for example suppose have 2 files :

(function(){     ... })() 

it's ok long it's in 2 separate files it's error if concatenate them done reduce number of requests. happens have

(a)()(b)() 

and engine trying call result of (a)() argument b.

adding semicolon delimit statements fix problem.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -