Skip to content

Commit f3a3ccb

Browse files
author
Kevin Morris
committed
Adds braces around all conditionals for clarity
1 parent bdadc05 commit f3a3ccb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/jquery.loadJSON.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@
6666
//setElementValue(last, obj[i], name);
6767
$(last).attr('value', obj[i].value);
6868
$(last).text(obj[i].text);
69-
if (obj[i].selected)
69+
if (obj[i].selected) {
7070
$(last).attr('selected', true);
71+
}
7172
i--;
7273
}
7374

@@ -182,10 +183,12 @@
182183
href = href.substr(0, iPosition) + '&' + name + '=' + value + href.substr(iPosition);
183184
} else {
184185
iPosition = href.indexOf('?');
185-
if (iPosition > 0) // If parameters in the URL exists add new pair using &
186+
187+
if (iPosition > 0) { // If parameters in the URL exists add new pair using &
186188
href += '&' + name + '=' + value;
187-
else //otherwise attach pair to URL
189+
} else { //otherwise attach pair to URL
188190
href = href + '?' + name + '=' + value;
191+
}
189192
}
190193
} else { // If no href exists, set href to value
191194
href = value;
@@ -245,9 +248,10 @@
245248
}
246249

247250
for (var prop in obj) {
248-
if (prop === null || typeof prop == 'undefined')
251+
if (prop === null || typeof prop == 'undefined') {
249252
continue;
250-
else {
253+
254+
} else {
251255
//Find an element with class, id, name, or rel attribute that matches the property name
252256
var child = jQuery.makeArray(jQuery('.' + prop, element)).length > 0 ? jQuery('.' + prop, element) :
253257
jQuery('#' + prop, element).length > 0 ? jQuery('#' + prop, element) :

0 commit comments

Comments
 (0)