Fra*_*cis 3 html php textarea ckeditor
我在PHP页面中添加了一个textarea控件,使用CKEditor的类.
现在,如果textarea加载为空,则CKEditor可以正常工作.但是,如果我尝试在textarea中加载PHP变量,页面会正确显示编辑器,但它不会显示内容(并且编辑器似乎被阻止).这是我的代码:
<div id="dialog-edit" title="Edit" style="display: none;">
<table cellspacing="10">
<tr>
<td>
<table>
<form method="post" name="form">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<br/>
<textarea class="ckeditor" name="html" id="html" style="width: 766px; height: 390px; margin-left: 6px;"><?php echo htmlentities($html) ?></textarea><br/>
<input type="submit" name="save" id="save" value="Salva modifiche" class="button" />
</form>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function showDialogEdit()
{
$( "#dialog-edit" ).dialog({
width: 680,
height: 620,
modal: true,
open: function(event, ui)
{
}
});
}
</script>
Run Code Online (Sandbox Code Playgroud)
textarea必须将内容(保存在MySQL数据库中作为HTML代码)显示在textarea中,但它没有这样做.
是什么造成了这个问题?
谢谢.
请尝试按照CKEditor演示文件夹中的"替换为代码"示例:
http://jsfiddle.net/mblase75/g2HFn/4/
$("#dialog-edit").dialog({
width: 680,
height: 620,
modal: true,
open: function (event, ui) {
CKEDITOR.replace('html');
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1000 次 |
| 最近记录: |