Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 22, 2019 14:19
Show Gist options
  • Save bjoerntx/f50e2ba1bd1d0b1c57d035d495405c35 to your computer and use it in GitHub Desktop.
Save bjoerntx/f50e2ba1bd1d0b1c57d035d495405c35 to your computer and use it in GitHub Desktop.
// this function loads a document directly server-side
function loadDocument(documentName)
{
// call the Web API endpoint LoadDocument with the
// stored, current ConnectionID
var serviceURL = "/api/TXDocument/LoadDocument?ConnectionID="
+ txSettings.ConnectionID +
"&DocumentName=" + documentName;
$.ajax({
type: "GET",
url: serviceURL,
contentType: 'application/json',
success: successFunc,
error: errorFunc
});
function successFunc(data, status) {
// set the loaded document name
loadedDocument = documentName;
}
function errorFunc() {
console.log("An error occured.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment