在dedecms中用以下方式调用了ueditor:
else if($GLOBALS['cfg_html_editor']=='ueditor1.4.3')
{
$fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
$code = '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor1.4.3/ueditor.all.min.js"></script>
<link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor1.4.3/themes/default/css/ueditor.css"/>
<textarea name="'.$fname.'" id="'.$fname.'" style="width:100%;">'.$fvalue.'</textarea>
<script type="text/javascript">var ue = new baidu.editor.ui.Editor();ue.render("'.$fname.'");</script>
</script>';
if($gtype=="print")
{
echo $code;
}
else
{
return $code;
}
}
使用ueditor的插入代码功能在文章里插入了html也保存成功并且能在前台正常显示,但是再次编辑文章已保存的调用之前插入的html就不能正常显示了:
插入的代码是这样的:
<li id="menu-item"><a href="#">首页</a></li>
<li id="menu-item"><a href="#">栏目1</a></li>
<li id="menu-item"><a href="#">栏目2</a></li>
<li id="menu-item"><a href="#">栏目3</a></li>
编辑的时候却成了这样的:
首页栏目1栏目2栏目3
看了下网页的源文件,里面代码没有错:
script type="text/javascript" charset="utf-8" src="/include/ueditor1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/include/ueditor1.4.3/ueditor.all.min.js"></script>
<link rel="stylesheet" type="text/css" href="/include/ueditor1.4.3/themes/default/css/ueditor.css"/>
<textarea name="body" id="body" style="width:100%;"><pre class="brush:html;toolbar:false"><li id="menu-item"><a href="#">首页</a></li>
<li id="menu-item"><a href="#">栏目1</a></li>
<li id="menu-item"><a href="#">栏目2</a></li>
<li id="menu-item"><a href="#">栏目3</a></li>1</pre><p></textarea>
<script type="text/javascript">var ue = new baidu.editor.ui.Editor();ue.render("body");</script>
</script>
求教各位高手,这样的话问题出在哪里呢,应该怎么改呢?
闭关修行中......