javascript - Insert HTML in NicEdit WYSIWYG -


how can insert text/code @ cursors place in div created nicedit?

i've tried read documentation , create own plugin, want work without tool bar (modal window)

this quick solution , tested in firefox only. works , should adaptable ie , other browsers.

function insertatcursor(editor, value){     var editor = niceditors.findeditor(editor);     var range = editor.getrng();                         var editorfield = editor.selelm();     editorfield.nodevalue = editorfield.nodevalue.substring(0, range.startoffset) +                             value +                             editorfield.nodevalue.substring(range.endoffset, editorfield.nodevalue.length); } 

Comments

Popular posts from this blog

php - How to build a web site which gives a sub-domain dynamically to every registered user? -

c# - Add item to Generic List / Collection using reflection -