diff --git a/js/lang.js b/js/lang.js index 177c1df..deedacc 100644 --- a/js/lang.js +++ b/js/lang.js @@ -17,14 +17,14 @@ $(document).ready(function () { function addLangLangs(langID, langName, langIDList) { if (langIDList != null) { - for (var i = 0; i < langIDList.length; i++) { + langIDList.forEach(function (item) { $.ajax({ url: "lang.php", type: "PUT", - data: {langID: langID, associatedLang: langIDList[i]}, + data: {langID: langID, associatedLang: item}, error: displayError }); - } + }); } successAlert("Successfully Added language: " + langName, "lang"); @@ -46,15 +46,15 @@ function loadLangs() { function addLangs(langList) { var mainList = $("#mainList"); - for (var i = 0; i < langList.length; i++) { - $("