I have recently noticed that a lot of JavaScript files on the web starts with ;
immediately following the comment section.
For example, this jQuery plugin's code starts with
/**
* jQuery.ScrollTo
* Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 9/11/2008
.... skipping several lines for brevity...
*
* @desc Scroll on both axes, to different values
* @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } );
*/
;(function( $ ){
Why does the file needs to start with ;
? I see this convention on server-side JavaScript files as well.
What is an advantage and disadvantage of doing this?