Created
January 19, 2016 13:40
-
-
Save bjoerntx/2b72adb7124dccfb619c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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