New to Kendo UI for jQueryStart a free 30-day trial

Set Encoded Special Characters as Editor Values

Environment

ProductProgress® Kendo UI® Editor for jQuery
Operating SystemAll
BrowserAll
Preferred LanguageJavaScript

Description

How can I set the encoded special characters as Editor values and display them decoded?

Solution

Prior to passing them as a parameter to the value method of the Editor, decode the encoded special characters.

<textarea id="editor"></textarea>
<script>
	$("#editor").kendoEditor();

	var editor = $("#editor").data("kendoEditor");
	var encodedString = "&lt;p&gt;Paragraph with a &gt; special character inside.&lt;/p&gt";
	var parser = new DOMParser;
	var dom = parser.parseFromString(
		'<!doctype html><body>' + encodedString,
		'text/html');
	var decodedString = dom.body.textContent;

	editor.value(decodedString);
</script>
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support