Skip to content

Commit 8b91698

Browse files
committed
Update index.html
1 parent cb8c7d5 commit 8b91698

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

2012/02/crossref-formatted-citations/index.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,24 @@ <h2 class="loaded">Formatted citation</h2>
7373
$.getJSON("http://api.crossref.org/locales")
7474
)
7575
.done(function(stylesResponse, localesResponse){
76+
var styles = stylesResponse.message.items;
77+
styles.sort();
78+
79+
var locales = localesResponse.message.items;
80+
locales.sort();
81+
7682
var form = $("#input");
7783

7884
var select = $("<select/>", { name: "style" });
79-
$.each(stylesResponse.message.items.sort(), function(index, value){
80-
$("<option/>", { text: value }).appendTo(select);
85+
$.each(styles, function(){
86+
$("<option/>", { text: this }).appendTo(select);
8187
});
8288
select.appendTo(form.find("label[for=style]"));
8389
select.val("apa");
8490

8591
var select = $("<select/>", { name: "locale" });
86-
$.each(localesResponse.message.items.sort(), function(index, value){
87-
$("<option/>", { text: value }).appendTo(select);
92+
$.each(locales, function(){
93+
$("<option/>", { text: this }).appendTo(select);
8894
});
8995
select.appendTo(form.find("label[for=locale]"));
9096
select.val("en-US");

0 commit comments

Comments
 (0)