Could somebody help me understand what does this syntax mean?
Why there is a ( in front of function(), and there is a )(); after the function end?
(function()
{
CKEDITOR.htmlParser.cdata = function( value )
{
this.value = value;
};
CKEDITOR.htmlParser.cdata.prototype =
{
type : CKEDITOR.NODE_TEXT,
writeHtml : function( writer )
{
writer.write( this.value );
}
};
})();
Could somebody please help me understand what does this syntax mean? Why there is a $ used in front of function()?
$ : function( rules )
{
this._ =
{
elementNames : [],
attributeNames : [],
elements : { $length : 0 },
attributes : { $length : 0 }
};
if ( rules )
this.addRules( rules, 10 );
},
Thanks a lot!
The next couple of parens is for executing this anonymous function. This is used basically to introduce scope.