Why the leading semicolon in JQuery ui.core.js? -


I started the code of ui.core.js in the jQuery UI is very interesting,

 ; JQuery.ui || (Function ($) {// code ...}) (jQuery);  

''; ' in front of?

This is for the purposes of unity, if someone wants to add this file the end of the second script The scripts that were not properly completed by the semi-colon have to effectively add stupid proof.

Therefore, the following script has been given:

  alotOfJsCode (logic); Var fileEnd = noSemiColon  

In the beginning, the semi-colon allows to prevent it:

  alotOfJsCode (logic); Var fileAnd = no smilecolnja (function ($) {// ...  

which will cause the code to fail.

In Javascript, a semi- The colon has no syntax all by itself. The following two statements are the same:

  // Statement 1 ;;;; alerts ('hello world!'); ;;;;;;;;;;;;;;;;; ; Alert ('Hello world!');  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -