问题描述
KindEditor.ready(function(K){//实现显示富文本的代码,第一个方法,实现添加的框架window.editorAdd=K.create('#txtMainContent',{cssPath:'../../../Content/kindeditor-4.1.10/plugins/code/prettify.css',uploadJson:'upload_json.ashx',fileManagerJson:'file_manager_json.ashx',allowFileManager:true,afterCreate:function(){varself=this;K.ctrl(document,13,function(){//添加保存信息的组合键ctrl+zself.sync();//同步富文本编辑器里的内容到textarea中去K('form[name="txtMainContent"]')[0].submit();});K.ctrl(self.edit.doc,13,function(){self.sync();K('form[name="txtMainContent"]')[0].submit();});}//,afterBlur:function(){this.sync();}});prettyPrint();});functionSubmit(){varparameters={IdField:"Scienceid",Scienceid:keyId,IdField:"Scienceid",Title:$("#txtTitle").val(),Spegin:$("#sltSpegin").val(),Statues:$("#sltStatues").val(),Content:getEditorAddData()};$.CallPage({url:url,param:parameters,OnSuccess:function(e){if(e.Result){$.ReturnOpener(e);}else{$.Alert(e.Message);}}});}
这样能保存,现在遇到的问题是if($('#hidIsEdited').val()=="False"){url+="Insert";keyId="GUID";}else{url+="Update";keyId=$('#hidId').val();varcontent='<%:Model.Content%>';if(content!=''){editorAdd.html(content);//}}
1:editorAdd.html(这里没法把值放上去,但是有时候又能放2:如果保存表情,修改模式在偶尔加载成功的时候,直接输出html<imgsrc='http://localhost:。。。'标签而不是表情请教各位,谢谢