Some js code style refactoring

Bad
if (success)
    do();

God
if (success) {
    do();
}

i = ''; //global
var i = ''; //local

Good
var $element = $('.class');
$element i think its dom element
Bad
var element = $('.class')