0

Making a WordPress plugin, using WordPress 3.5.2

I'm using wp_editor() on the front end, inside jquery UI tabs [ajax loading tabs + 2 editors on the same panel], and I'm getting the following error, when clicking visual.

switchEditors is not defined

I've even tried adding this; it errors out tinyMCE is not defined.

this is my code:

<div id="tabs">
<ul id="wpsca_ul">
    <li><a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscalist';?>" title="manage list"><?php echo __('Manage Pages','wpsca_lang');?></a></li>
    <li><a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscaaddedit';?>" title="manage addedit"><?php echo __('Add Page','wpsca_lang');?></a></li>
    <li><a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscasettings';?>" title="manage settings"><?php echo __('Settings','wpsca_lang');?></a></li>
</ul>

<div id="manage_list">loading...</div>
<div id="manage_addedit" class="ui-tabs-hide">loading...</div>
<div id="manage_settings" class="ui-tabs-hide">loading...</div>
</div><!-- tabs -->

And I'm picking the tabs up on init;

Any direction would be appreciated

1

I have tackled this by putting TinyMCE on the first tab, and making it a static tab, all others are still ajax, would still like it to be ajax, if anyone has any solutions.

<div id="tabs">
<ul id="wpsca_ul">
    <li><a href="#wpsca_addedit" title="add page"><?php echo __('Add Page','wpsca_lang');?></a></li>
    <li><a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscalist';?>" title="manage addedit"><?php echo __('Manage Pages','wpsca_lang');?></a></li>
    <li><a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscasettings';?>" title="manage settings"><?php echo __('Settings','wpsca_lang');?></a></li>
</ul>

<div id="wpsca_addedit">
< ? php wp_editor() coding ?>
</div>
<div id="manage_list" class="ui-tabs-hide">loading...</div>
<div id="manage_settings" class="ui-tabs-hide">loading...</div>
</div><!-- tabs -->
|improve this answer|||||
  • It is unlikely to work as ajax since tinymce requires JS to be loaded for it to work, and this loading of the JS is hard to be done in ajax – Mark Kaplun Jan 7 '17 at 5:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.