Last active
January 7, 2021 21:54
-
-
Save bjoerntx/32d337bab13f449466d9700278ec68f4 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 mergeDocument() { | |
// save the document in the internal tx format | |
TXTextControl.saveDocument(TXTextControl.StreamType.InternalUnicodeFormat, | |
function (e) { | |
var serviceURL = "@Url.Action("Merge", "Home")"; | |
// send document to controller | |
$.ajax({ | |
type: "POST", | |
url: serviceURL, | |
data: { | |
document: e.data // the template | |
}, | |
success: successFunc, | |
error: errorFunc | |
}); | |
}); | |
} | |
function successFunc(data, status) { | |
// load the resulting document back into the editor | |
TXTextControl.loadDocument(TXTextControl.StreamType.InternalUnicodeFormat, data); | |
} | |
function errorFunc() { | |
alert("Error"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment