js方法如下:
-
JScript code
-
function commitForm(){ if(/^\s*$/.test((FCKeditorAPI.GetInstance("msg.content").EditorDocument.body.innerText))){ alert("内容不得为空"); return false; } }
调用FCKeditor实体:
-
JScript code
-
<!-- fckeditor --> <script type="text/javascript" src="<%=basePath %>fckeditor/fckeditor.js"></script> <script type="text/javascript"> window.onload = function(){ var oFCKeditor = new FCKeditor("msg.content"); oFCKeditor.BasePath = "<%= request.getContextPath() %>/components/fck/"; oFCKeditor.Height = '100%'; oFCKeditor.ReplaceTextarea(); } </script> <!-- end of fvkeditor -->
-
本文介绍如何利用FCKeditor和JavaScript在网页中实现富文本编辑功能,包括初始化FCKeditor实例、设置参数及调用相关方法。
259

被折叠的 条评论
为什么被折叠?



