Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created April 16, 2019 21:25
Show Gist options
  • Save bjoerntx/697afcb8c288dcd1547208c55ebbd1d4 to your computer and use it in GitHub Desktop.
Save bjoerntx/697afcb8c288dcd1547208c55ebbd1d4 to your computer and use it in GitHub Desktop.
<input type="button" onclick="loadEditor()" value="Load Editor" />
<div id="editor"></div>
<script>
function loadEditor() {
// check, if editor exists and
// closes the WebSocket connection gracefully
// and removes the whole editor from the DOM.
if (typeof TXTextControl !== 'undefined')
TXTextControl.removeFromDom();
// load the partial view
$('#editor').load('@Url.Action("EditorPartial")');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment