读书人

FCKeditor使用的有关问题

发布时间: 2011-12-26 23:09:58 作者: rapoo

FCKeditor使用的问题
我用AJAX从数据库里提出需要修改的网页来,怎么把数据输入到FCKeditor中。我输入的内容是网址比如: <p> <input type= "text " /> </p>
在FCKeditor中显示的源代码是 <p> <p><input type="text" /></p> </p>
我怎么样才能让FCKeditor显示的源代码是 <p> <input type= "text " /> </p>


[解决办法]
<FCK:editor id= "content "> <c:out value= "${vo.CONTENT} " escapeXml= "true "/> </FCK:editor>
如上,escapeXml的值为true或false,true可以解析


[解决办法]
用正则表达式吧
<script language= "javascript ">
var str= " <p> <p><input type="text" /></p> </p> ";
str=str.replace(/>/g, "> ");
str=str.replace(/</g, " < ");
str=str.replace(/"/g, " \ " ");
alert(str);
</script>

读书人网 >Java Web开发

热点推荐