Reputation: 741
Been trying to enter some javascript using a CKEditor dialog, tried editor.document.createFromHtml('<script> some javascript </script>');
which only created a set of empty script tags. Did not really change anything and now I get the error:
createFromHtml is not a function
and cannot figure out what is wrong.
onOk : function()
{
//var eHtml = this.getContentElement('tab1','selectedGraph').getElement();
var graphscript = editor.document.createFromHtml( ' <script type="text/javascript"> <script>' );
//var graph = editor.document.createElement( 'div' );
//graph.setAttribute('id', 'graph'); //dialog.getValueOf( 'tab1', 'abbr' ) );
//editor.insertElement( graph );
//graphscript.setValue('test'); //dialog.getValueOf( 'tab1', 'abbr' ) );
//editor.insertElement( graphscript );
}
Upvotes: 2
Views: 110
Reputation: 741
I got it working by using this:
CKEDITOR.dom.element.createFromHtml('somejavascipt', editor.document );
Upvotes: 1
Reputation: 1
Take a look at:
http://ckeditor.com/forums/Support/Second-Time-jQuery-Doesnt-Work
they had the same problem then figured it out so this should help you
Upvotes: 0