【发布时间】:2019-03-22 03:57:25
【问题描述】:
我最近克隆了一个脚本,虽然原始脚本中的 CKEditor 文本区域可以正常工作,但新脚本中的文本区域却不行。
原脚本代码如下:
<td align="left" valign="top">Description: <a target="_blank" href="faq_bb.php#edit"><img title = "<?= $bb_help; ?>" alt="<?= $bb_help; ?>" height=17 width=19 border=0 src="/images2/query_icon.gif"></a>
</td>
<td valign=top align="left" colspan=2>
<?php
$winsize = strlen($bb_desc);
if ($winsize < 255)
{
$editorheight = 10;
}
else
{
$editorheight = 20;
}
$text = html_entity_decode($bb_desc, ENT_QUOTES);
?>
<textarea name="_bb_desc" cols=<?= $editorheight ?>>
<?= $text ?>
</textarea>
<script type="text/javascript">
CKEDITOR.replace( '_bb_desc');
</script>
</td>
新脚本有:
<td align="left" valign="top">Description: <a target="_blank" href="faq_bb.php#edit"><img title = "<?= $bb_help; ?>" alt="<?= $bb_help; ?>" height=17 width=19 border=0 src="/images2/query_icon.gif"></a>
</td>
<td valign=top align="left" colspan=2>
<?php
$winsize = strlen($bb_desc);
if ($winsize < 255)
{
$editorheight = 10;
}
else
{
$editorheight = 20;
}
$text = html_entity_decode($bb_desc, ENT_QUOTES);
?>
<textarea name="_bb_desc" cols=<?= $editorheight ?>>
<?= $text ?>
</textarea>
<script type="text/javascript">
CKEDITOR.replace( '_bb_desc');
</script>
</td>
在 Web Console Element Inspector 中查看呈现的页面,原始脚本生成:
<iframe src="" style="width: 100%; height: 100%;" class="cke_wysiwyg_frame cke_reset" title="Rich Text Editor, _bb_desc" aria-describedby="cke_87" tabindex="0" allowtransparency="true" frameborder="0"></iframe>
新脚本产生:
<iframe src="" style="width: 100%; height: 100%; display: none !important;" class="cke_wysiwyg_frame cke_reset" title="Rich Text Editor, _bb_desc" aria-describedby="cke_72" tabindex="0" allowtransparency="true" hidden="" frameborder="0"></iframe>
这两个脚本在相同的环境中执行,使用相同版本的 CKEditor (4.5.3.Full)。
对于可能导致不同行为的任何建议,我们将不胜感激。
【问题讨论】:
标签: ckeditor