Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created April 15, 2024 16:31
Show Gist options
  • Save bjoerntx/5ba5a3125679c18b8e3cdcd150130a10 to your computer and use it in GitHub Desktop.
Save bjoerntx/5ba5a3125679c18b8e3cdcd150130a10 to your computer and use it in GitHub Desktop.
@using TXTextControl.Web.MVC
@Html.TXTextControl().TextControl().Render()
<button onclick="loadDocument()">Load Document</button>
<script>
function loadDocument() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "Home/LoadDocument", true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
TXTextControl.loadDocument(
TXTextControl.StreamType.InternalUnicodeFormat,
xmlhttp.responseText);
}
}
xmlhttp.send();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment