大拿帮忙啊!!!急死了!!!弄了好久!!!
请问用什么方法将以下数据库mysql的内容放到tinymce编辑器中:
下面我给大家讲讲javascript函数:
<script> <BR>function show() <BR>{ <BR>alert("hello world"); <BR>} <BR></script> 结果如图:
直接用PHP的select出来的,没有用!不能显示JS代码那一段,如图:

而我不用select出来的话直接用JS,代码如下:
<br><script><br>window.onload=function()<br>{<br> var text_id=document.getElementById("Article_Content"); //textarea的id<br> var content='<P>下面我给大家讲讲javascript函数:<PRE class=js name="code"><script> <BR>function show() <BR>{ <BR>alert("hello world"); <BR>} <BR></script> 结果如图:';
text_id.value=content;
//SetTinyMceContent("Article_Content",content);
}
却能够达到效果,如图:
我不知道是什么原因导致这种情况的,firebug出来的内容发现,主要是<script> 和<script>的区别,请问怎么解决这个问题????想了好久,就是不知道,,,,<br><font color="#ff8000">------解决方案--------------------<br></script>
$new_content='<p>下面我给大家讲讲javascript函数:</p><PRE class=js name="code"><script> <BR>function show() <BR>{ <BR>alert("hello world"); <BR>} <BR></script> 结果如图:
echo preg_replace_callback('//i', function($r){return htmlentities($r[0]);}, $new_content) ;

------解决方案--------------------
你想要什么效果?
把 html 代码放在 textarea 中时应做 html 实体转换:htmlentities










