[英]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功能,因此,從最新版本開始,可能會拋出曲線球嗎?
逐步嘗試這些,看看它們是否解決了問題:
用2014替換現有主題
禁用所有插件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.