Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 19, 2019 15:22
Show Gist options
  • Save bjoerntx/65233add661cfd476ea2e8182970dc0c to your computer and use it in GitHub Desktop.
Save bjoerntx/65233add661cfd476ea2e8182970dc0c to your computer and use it in GitHub Desktop.
// get available dictionary names and add them to select element
function getUserDictionaryFilenames() {
var serviceURL = "/api/Dictionary/UserDictionaryFilenames/";
$.ajax({
type: "GET",
url: serviceURL,
contentType: 'application/json',
success: successFunc,
error: errorFunc
});
function successFunc(data, status) {
data.forEach(function (item) {
// append the options
$("#availableDictionaries").append("<option>" + item + "</option>");
});
}
function errorFunc() {
console.log("error");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment