Closed Meakrothany closed 7 years ago
Please, see the thread in #34, and specially one of my last comments.
$("#txtEditor").Editor("setTxt","<?php echo $data;?>");
});`
it work from me! i mean i want to display to view page not setText to editor! i want to display from db to view page all content and image to view page.
This my code!
$my_var="test"; $("#txtEditorContent").Editor("setText","<?php echo $my_var;?>");
and this is error
Uncaught TypeError: Cannot read property 'html' of undefined at n.fn.init.setText (editor.js:1575) at n.fn.init.$.fn.Editor (editor.js:1606) at HTMLDocument.<anonymous> (437:797) at i (jquery-2.2.3.min.js:2) at Object.fireWith [as resolveWith] (jquery-2.2.3.min.js:2) at Function.ready (jquery-2.2.3.min.js:2) at HTMLDocument.J (jquery-2.2.3.min.js:2)
help me pls!
You have to instantiate the editor with $("#txtEditor").Editor()
first in order to be able to use setText
.
You have a good example in a comment on the thread #34 by @mouraleonardo (only I would replace addslashes
with json_encode
).
okay i see thank! for your help!
I line-control to insert content to database and i can get it back and set content from database to editor but i don't how to display from database to view page? can you show me? i try to search a lot on internet but don't provide document to to get content to view page just tell set to editor back.