TinyMCE没有定义Jquery [英] TinyMCE is not defined Jquery

查看:82
本文介绍了TinyMCE没有定义Jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经处理了这个错误2天,无法让TinyMCE工作。我正在使用TinyMCE的jquery版本。下面是我的HTML代码,其中包含一个包含textarea的表单。我使用Google Inspect Element并在控制台选项卡下面出现以下错误:Uncaught ReferenceError:tinymce未定义。任何帮助将不胜感激。

Have been working on this error for 2 days and cannot get TinyMCE to work. I am using the jquery version of TinyMCE. Below is my HTML code with a form that contains a textarea. I use Google Inspect Element and under the console tab i get the following error: "Uncaught ReferenceError: tinymce is not defined". Any help would be appreciated.

<form id="add_update_form" action="" method="POST" title="Add Blog">

<p class="feedback"></p>

<!-- <label>Created:</label>
<input type="text" name="created"> -->

<label>Title:</label>
<input type="text" name="title" class="input-block-level">

<label>Content:</label>
<textarea width="100%" rows="10" cols="10" name="content" class="input-block-level"></textarea>

<div class="clear"></div>

</form>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"    type="text/javascript"></script>
<script src="<?php echo base_url();?>js/portal/tinymce/jquery.tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
plugins: [
    "advlist autolink lists link image charmap print preview anchor",
    "searchreplace visualblocks code fullscreen",
    "insertdatetime media table contextmenu paste moxiemanager"
],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
});
</script>


推荐答案

当您使用jquery版本时,您需要将其设置为jquery插件

As you are using the jquery version you'll need to set it up like a jquery plugin

$(function() {
   $('textarea.tinymce').tinymce({
    ...
   });
});

http://www.tinymce.com/tryit/3_x/jquery_plugin.php

这篇关于TinyMCE没有定义Jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆