繁体   English   中英

TypeError:tinymce.get(…)为空-似乎无法正确找到ID

[英]TypeError: tinymce.get(…) is null - Does not seem to be finding ID properly

我在Wordpress中使用tinymce来满足一些自定义需求。 它工作正常,但现在似乎抛出了我以前没有的错误。

从Firebug

TypeError:tinymce.get(...)为null

geqqo_new:tinymce.get('geqqo-editor-new')。getContent()

但是,事情看起来非常合理-他们以前工作过-因此请仔细检查我:

JS

tinymce.get('geqqo-editor-new').getContent() 

生成的HTML

<form action="" method="post" target="_blank">
    <div id="wp-geqqo-editor-new-wrap" class="wp-core-ui wp-editor-wrap html-active">
        <link rel='stylesheet' id='editor-buttons-css'  href='http://localhost/hawaii/somelocal/wp-includes/css/editor.min.css?ver=3.9' type='text/css' media='all' />
        <div id="wp-geqqo-editor-new-editor-tools" class="wp-editor-tools hide-if-no-js">
            <div id="wp-geqqo-editor-new-media-buttons" class="wp-media-buttons"><a href="#" id="insert-media-button" class="button insert-media add_media" data-editor="geqqo-editor-new" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a></div>
            <div class="wp-editor-tabs"><a id="geqqo-editor-new-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">Text</a>
                <a id="geqqo-editor-new-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">Visual</a>
            </div>
        </div>
        <div id="wp-geqqo-editor-new-editor-container" class="wp-editor-container"><textarea class="wp-editor-area" rows="20" autocomplete="off" cols="40" name="content" id="geqqo-editor-new"></textarea></div>
    </div>
</form>

因此,考虑所有因素后,为什么会出现上述错误?

此外,这是使用Wordpress的tinymce功能,因此,从最新版本开始,可能会抛出曲线球吗?

逐步尝试这些,看看它们是否解决了问题:

  1. 用2014替换现有主题

  2. 禁用所有插件

暂无
暂无

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

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