您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > 关于jsp使用兼容版kindeditor编辑器的方法
jsp关于使用兼容版kindeditor编辑器的方法备注:js能取值,修改能改值1、增加页面调用add.jsp《如图》代码在下%@pagecontentType=text/html;charset=GBKerrorPage=../error.jsp%%@pageimport=zr.zrpower.ewebeditor.fileService.FileManageService%%@pageimport=zr.zrpower.entity.sys.SessionUser%%@pageimport=zr.zrpower.ejb.sys.UIService%%@pageimport=java.util.*%%@pageimport=java.text.*%%FileManageServicefileManage=newFileManageService();UIServiceuserUI=newUIService();SessionUseruser=(SessionUser)session.getAttribute(userinfo);Stringstate=request.getParameter(state);StringstrRECORDID=request.getParameter(RECORDID);if(strRECORDID==null){strRECORDID=;}if(strRECORDID.length()==0){strRECORDID=fileManage.GlobalID();//生成附件编号}%HTMLHEADTITLE文章添加/TITLEMETAHTTP-EQUIV=PragmaCONTENT=no-cacheMETAhttp-equiv=Content-Typecontent=text/html;charset=gb2312LINKtype=text/cssrel=stylesheethref=../zrsysmanage/css/%=user.getUserCSS()%SCRIPTLANGUAGE=JavaScriptsrc=../zrsysmanage/script/Public.js/SCRIPTscriptlanguage=JavaScripttype=//编辑器应用开始functiondoCheck(){//检测表单的有效性//如:标题不能为空,内容不能为空,等等....if(eWebEditor1.getHTML()==){alert(内容不能为空!);return;}//表单有效性检测完后,自动上传远程文件//函数:remoteUpload(strEventUploadAfter)//参数:strEventUploadAfter;上传完后,触发的函数名,如果上传完后不需动作可不填参数eWebEditor1.remoteUpload();}//有效性检察functionCheck(theForm){alert(theForm.content.value);if(theForm.content.value!=){theForm.FCONTENT.value=theForm.content.value;}if(trim(theForm.TITLE1.value)==){alert(文章标题不能为空!);theForm.TITLE1.focus();return;}if(theForm.TITLE1.value.length100){alert(文章标题长度不能超过100!);theForm.TITLE1.focus();return;}if(theForm.TITLE2.value.length100){alert(文章副标题长度不能超过100!);theForm.TITLE2.focus();return;}if(theForm.FSOURCE.value.length100){alert(文章来源长度不能超过100!);theForm.FSOURCE.focus();return;}if(theForm.KEYWORDS.value.length100){alert(文章关键字长度不能超过100!);theForm.KEYWORDS.focus();return;}if(theForm.AUTHOR.value.length100){alert(文章作者长度不能超过100!);theForm.AUTHOR.focus();return;}if(theForm.content.value==){alert(内容不能为空!);return;//returnfalse;}document.form1.submit();}/script/HEADBODYclass=BodyMain%StringID=fileManage.GetMaxFieldNo();Calendarcal=Calendar.getInstance();SimpleDateFormatformatter=newSimpleDateFormat(yyyy-MM-ddHH:mm:ss);StringmDateTime=formatter.format(cal.getTime());%formaction=../actionfilesmanage.domethod=postname=form1inputtype=hiddenname=FILENOvalue='%=ID%'/inputtype=hiddenname=ADDUSERNOvalue='%=user.getUserID()%'/inputtype=hiddenname=EDITDATEvalue='%=mDateTime%'/inputtype=hiddenname=FSTATEvalue='2'/inputtype=hiddenname=FDEGREEvalue='0'/inputtype=hiddenname=REGIONALISMvalue='%=user.getUnitID()%'/inputtype=hiddenname=FILEIDvalue=%=strRECORDID%inputtype=hiddenname=SEDFLAGEvalue=1!--HTMLHead--!--HTMLHead表单头显示[显示内容,用户肤色的图片文件夹]--%=userUI.ShowHeadHtml(公共文件管理,user.getUserImage())%!--HTMLBodyStart显示表单开始部分--%=userUI.ShowBodyStartHtml()%DIVid=divMessagestyle='position:absolute;width:100%;height:100%;overflow:auto'br fieldsetstyle=width:98%legend新建文章/legendTABLEwidth=100%align=centerborder=0TRTDcolspan=2height=5inputclass=inputtype=hiddenname=Actvalue=add//TD/TRTRTDclass=PutdSetwidth=15%文章标题:/TDTDinputclass=texttype=textname=TITLE1size=80maxlength=200Fontclass=WriteSign */Font/TD/TRTRTDclass=PutdSetwidth=15%文章副标题:/TDTDinputclass=texttype=textname=TITLE2size=80maxlength=200/TD/TRTRTDclass=PutdSetwidth=15%文章来源:/TDTDinputclass=texttype=textname=FSOURCEsize=80maxlength=200br//TD/TRTRTDclass=PutdSetwidth=15%审核:/TDTDinputclass=texttype=textname=KEYWORDSsize=80maxlength=200/TD/TRTRTDclass=PutdSetwidth=15%作者:/TDTDinputclass=texttype=textname=AUTHORsize=80maxlength=50/TD/TRTRTDclass=PutdSetwidth=15%valign=topdivid=div1style=display:''文章内容:/div/TDTD/TD/TRTRTDcolspan=2align=centerdivid=textareastyle=display:nonetextareaid=FCONTENTname=FCONTENTrows=8cols=55 /textarea/divdivid=div2style=display:''%--编辑器开始--%linkrel=stylesheethref=../webedit/themes/default/default.css/linkrel=stylesheethref=../webedit/plugins/code/prettify.css/scriptcharset=utf-8src=../webedit/kindeditor.js/scriptscriptcharset=utf-8src=../webedit/lang/zh_CN.js/scriptscriptcharset=utf-8src=../webedit/plugins/code/prettify.js/scriptscriptKindEditor.ready(function(K){window.editor=K.create('textarea[name=content]',{cssPath:'../webedit/plugins/code/prettify.css',uploadJson:'../webedit/jsp/upload_json.jsp',fileManagerJson:'../webedit/jsp/file_manager_json.jsp',allowFileManager:true,afterBlur:function(){this.sync();}});});/scripttextareaid=eWebEditor1name=contentstyle=width:96%;height:350px;visibility:hidden;/textarea%--编辑器结束--%/div/TD/TRtrtdheight=85colspan=2iframeid=attname=attsrc=../zrsysmanage/att/AttAddFrm.jsp?FLOWID=mail&DOCID=%=strRECORDID%&AID=mail&TYPE=1border=0frameborder=0width=100%height=100%/iframe/td/trTRTDcolspan=2height=23/TD/TR/TABLEbr/fieldsetcenterbrtablecellspacing=0cellpadding=0bor
本文标题:关于jsp使用兼容版kindeditor编辑器的方法
链接地址:https://www.777doc.com/doc-2665538 .html