javascript - Setting Data in to CK Editor from word file -
my question follows.
we using ckeditor show content of docx file within editor. ckeditor loaded in our documnentum application.
i read word file , converted html. when trying set info of html file using
ckeditor.instances.editor1.setdata('abc');
it giving me "abc" value in screen:
<% file file = new file("c:\\testwordtohtml\\html\\test.html"); bufferedreader br = null; stringbuilder sb=new stringbuilder(); seek { string scurrentline; br = new bufferedreader(new filereader(file)); while ((scurrentline = br.readline()) != null) { sb.append(scurrentline); //system.out.println(scurrentline); } system.out.println("final content is"+" "+sb.tostring()); } grab (ioexception e) { e.printstacktrace(); } { seek { if (br != null)br.close(); } grab (ioexception ex) { ex.printstacktrace(); } } string htmdata = sb.tostring();`enter code here` %> var abc=htmdata; ckeditor.instances.editor1.setdata('abc');
your code is... - poor. have larn how pass variable js, because in js htmdata
undefined
. need pass variable setdata()
method. pass there 'abc'
string, not abc
variable.
so js part should this:
ckeditor.instances.editor1.setdata(htmdata);
javascript ckeditor
No comments:
Post a Comment