To be technically perfect, javascript like HTML needs to follow certain syntax rules. However, browsers will error correct for a lot.
These technicalities become increasingly important if one wants to compress and/or encrypt ones code. And if code is being imported via the responseText or responseXML of an AJAX or other server request.
In your example though the two versions are not equivalent. If brackets are omitted, only the immediately following directive is a part of the conditional. So
Code:
if(jQuery.support.opacity)
$('div.box-5').find('div.movebox-content *').fadeTo(200, 1);
else
$('div.box-5').find('div.movebox-content *').css("visibility","visible");
$(document).trigger("newBackground",[nI]);
is equivalent to:
Code:
if(jQuery.support.opacity){
$('div.box-5').find('div.movebox-content *').fadeTo(200, 1);
} else {
$('div.box-5').find('div.movebox-content *').css("visibility","visible");
}
$(document).trigger("newBackground",[nI]);
Bookmarks