CKEditor文本区域创建显示:无



>我最近克隆了一个脚本,虽然原始脚本中的 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 控制台元素检查器中查看呈现的页面时,原始脚本将生成:

<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( 版本。

任何关于可能导致不同行为的原因的建议将不胜感激。

好吧,我找到了解决方案,尽管我并不比以前更了解问题所在。

问题似乎是由脚本名称引起的。如果它被称为跟踪器.php,则CKEditor无法正常工作。显然,将其更改为其他任何东西都可以解决问题。

奇怪。

最新更新