I am attempting to insert some HTML into a CKEditor instance. However, each time that I do it ends up inserting javascript into the editor. I'm going to guess that it has something to do with escape characters maybe? Does anyone know how to prevent this from happening?
Example:
Execute this
editor.insertHtml('<div class="report-template-score" title="' + $(this).text + '">' + $(this).text + '</div>');
Which inserts this
function (a) { if (f.isFunction(a)) { return this.each(function (b) {var c = f(this);c.text(a.call(this, b, c.text()));}); } if (typeof a != "object" && a !== b) { return this.empty().append((this[0] && this[0].ownerDocument || c).createTextNode(a)); } return f.text(this); }
Any assistance would be greatly appreciated!
Example:
Execute this
editor.insertHtml('<div class="report-template-score" title="' + $(this).text + '">' + $(this).text + '</div>');
Which inserts this
function (a) { if (f.isFunction(a)) { return this.each(function (b) {var c = f(this);c.text(a.call(this, b, c.text()));}); } if (typeof a != "object" && a !== b) { return this.empty().append((this[0] && this[0].ownerDocument || c).createTextNode(a)); } return f.text(this); }
Any assistance would be greatly appreciated!
Re: insertHtml is inserting javascript
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: insertHtml is inserting javascript