Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 19, 2019 15:23
Show Gist options
  • Save bjoerntx/6411391335c84887a2357e059840d2cc to your computer and use it in GitHub Desktop.
Save bjoerntx/6411391335c84887a2357e059840d2cc to your computer and use it in GitHub Desktop.
// load a specific user dictionary
function loadUserDictionary() {
// call Web API endpoint to retrieve the dictionary
var serviceURL = "/api/Dictionary/LoadUserDictionary?filename="
+ $("#availableDictionaries").val();
$.ajax({
type: "GET",
url: serviceURL,
contentType: 'application/json',
success: successFunc,
error: errorFunc
});
function successFunc(data, status) {
// enable spell checking
TXTextControl.isSpellCheckingEnabled = true;
// load user dictionary
TXTextControl.Proofing.loadUserDictionary(data.name, data.words, data.language);
alert("Dictionary " + data.name + " successfully loaded.");
}
function errorFunc() {
console.log("error");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment