Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created January 19, 2016 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/2b72adb7124dccfb619c to your computer and use it in GitHub Desktop.
Save bjoerntx/2b72adb7124dccfb619c to your computer and use it in GitHub Desktop.
function Merge() {
// save the document
TXTextControl.saveDocument(
TXTextControl.streamType.InternalUnicodeFormat,
function (e) {
var serviceURL = "/Home/Merge";
// call the controller
$.ajax({
type: "POST",
url: serviceURL,
contentType: 'application/json',
data: JSON.stringify({
BinaryDocument: e.data
}),
success: successFunc,
error: errorFunc
});
// the controller sends back the merged document
// that is loaded into the editor
function successFunc(data, status) {
TXTextControl.loadDocument(
TXTextControl.streamType.InternalUnicodeFormat, data);
alert("Document has been merged successfully.");
}
function errorFunc() {
alert('Error');
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment