《JS集成fckeditor及推断内容是否为空的方法_.docx》由会员分享,可在线阅读,更多相关《JS集成fckeditor及推断内容是否为空的方法_.docx(4页珍藏版)》请在三一文库上搜索。
1、JS集成fckeditor及推断内容是否为空的方法_ 这篇文章主要介绍了JS集成fckeditor及推断内容是否为空的方法,涉及fckeditor的设置及页面元素的操作技巧,并分析了php环境下配置文件上传的留意事项,需要的伴侣可以参考下 本文实例讲解并描述了JS集成fckeditor及推断内容是否为空的方法。分享给大家供大家参考,具体如下: script type=text/javascript !- / Automatically calculates the editor base path based on the _samples directory. / This is usefu
2、ll only for these samples. A real application should use something like this: / oFCKeditor.BasePath = /fckeditor/ ; / /fckeditor/ is the default value. var sBasePath =/fckeditor/; var oFCKeditor = new FCKeditor( news_content ) ; oFCKeditor.BasePath = sBasePath ; oFCKeditor.Height = 400 ; oFCKeditor.
3、Width = 600 ; oFCKeditor.Value = ; oFCKeditor.Create() ; /- /取fck内容的长度 function GetMessageLength(str) var oEditor = FCKeditorAPI.GetInstance(str) ; var oDOM = oEditor.EditorDocument ; var iLength ; if ( document.all ) / If Internet Explorer. iLength = oDOM.body.innerText.length ; else / If Gecko. va
4、r r = oDOM.createRange() ; r.selectNodeContents( oDOM.body ) ; iLength = r.toString().length ; / oEditor.InsertHtml() return iLength function CheckPost() if(GetMessageLength(news_content)=0) alert(请输入内容); return false; /取fck内容 function GetMessageContent(str) var oEditor = FCKeditorAPI.GetInstance(st
5、r) ; return oEditor.GetXHTML(); /script 当有以下config.php配置时: $ConfigUserFilesPath = /upload/ ; $ConfigAllowedExtensionsImage = array(bmp,gif,jpeg,jpg,png) ; $ConfigDeniedExtensionsImage = array() ; $ConfigFileTypesPathImage = $ConfigUserFilesPath . image/ ; $ConfigFileTypesAbsolutePathImage= ($ConfigU
6、serFilesAbsolutePath = ) ? : $ConfigUserFilesAbsolutePath.image/ ; $ConfigQuickUploadPathImage = $ConfigUserFilesPath ; $ConfigQuickUploadAbsolutePathImage= $ConfigUserFilesAbsolutePath ; 上传时,快速上传将挺直上传到upload名目下 非快速上传将传到upload/image名目下 扫瞄服务器时图片扫瞄将指向upload/image所以快速上传的图片在扫瞄服务器时,不能扫瞄到。 盼望本文所述对大家JavaScript程序设计有所关心。 .