i have tried to create new element and insert after ckeditor’s old element
Working Code Is Below:
var str = "<Element1>sometext</Element1>";
var Newelement = CKEDITOR.dom.element.createFromHtml(str);
Newelement.insertAfter(oldElement);
working in FF & IE
Non Working Code Is Below:
var str = "<Element1></Element1>";
var Newelement = CKEDITOR.dom.element.createFromHtml(str);
Newelement.insertAfter(oldElement);
working in FF
but not working in IE
IE Error:
Error on CKEDITOR.dom.element.createFromHtml(str)
The Error : 'getFirst()' is null or not an object
Error Number : -2146823281
This can be this can be bug in IE i guess
If you are trying to create element in Head (if your code is between it was not able to create in tags) there is a patch for this but i could not find the link
Or try to create element in (put your script block in same section with the destination)
This can solve your issue
This issue is specific to IE-8
if you try with IE-9 it must not be the case