简体   繁体   English

使用 CKEDITOR 会隐藏默认的 TEXTAREA 并且不显示 CKEDITOR

[英]Using CKEDITOR hides the default TEXTAREA and doesn't display CKEDITOR

I want to implement CKEDITOR.我想实现CKEDITOR。 I included the ckeditor in footer and replaced all.我在页脚中包含了 ckeditor 并替换了所有内容。

<script src="<?= site_url('theme/black/assets/plugins/ckeditor/ckeditor.min.js') ?>" type="text/javascript"></script>
<script>
CKEDITOR.replaceAll();
</script>

And in my HTML, I have在我的 HTML 中,我有

<div class="clearfix"></div>
<div class="col-md-12">
    <div class="form-group">
        <label class="control-label col-md-2">Text<span class="required">*</span></label>
        <div class="col-md-8">
            <textarea name="text" id="text" class="form-control ckeditor" style="height:100px;"><?= $results[0]['text']; ?></textarea>
            <span class="help-block"></span>
        </div>
    </div>
</div>

But it hides my default TEXTAREA, and I don't see any CKEDITOR.但它隐藏了我的默认 TEXTAREA,我看不到任何 CKEDITOR。 When I inspect the element, the visibility for default textarea is set to hidden.当我检查元素时,默认 textarea 的可见性设置为隐藏。 What have I done wrong?我做错了什么?

Keep ckeditor folder in your project directory and provide reference from that as beloow将 ckeditor 文件夹保留在您的项目目录中,并提供如下参考

<script src="~/ckeditor/ckeditor.js"></script>
<script src="~/ckeditor/styles.js"></script>

than you can create text areas as usual you have done.您可以像往常一样创建文本区域。

If you are referencing your app.js like this:如果你像这样引用你的 app.js:

<script src="{{ asset('js/app.js') }}" defer></script>

Change it to this format:将其更改为这种格式:

<script src="{{ asset('js/app.js') }}"></script>

In your app.blade.php file在你的app.blade.php文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM