Solution:
Add wp_editor()
in somewhere that works perfectly and hide it.
<div class="hidden-editor-container" style="display:none;">
<?php wp_editor( '', 'editor' ); ?>
</div>
after that assign editor contents to the global JS variable.
EDITOR = $('.hidden-editor-container').contents();
Finally when the ajax page is loaded append editor contents
$('.editor').append( EDITOR );
tinymce.execCommand( 'mceRemoveEditor', false, 'editor' );
tinymce.execCommand( 'mceAddEditor', false, 'editor' );
Related Posts:
- Load tinyMCE / wp_editor() via AJAX [duplicate]
- help on wp_editor via ajax load [duplicate]
- Insert wp_editor on front-end with AJAX?
- How to load wp_editor() through AJAX/jQuery
- How to load wp_editor via AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Saving (Updating) Post / Page Edits With AJAX
- When using javascript to dynamically add a textarea, how can I render it as a tinyMCE editor (in wordpress)?
- Setting TinyMCE Content in wp_editor
- How to load wp_editor via AJAX
- wp_editor in thickbox
- How to make image in TinyMCE clickable
- Failed to load resource: the server responded with a status of 404 (Not Found) admin-ajax.php
- How to load WP_Editor JS files manually (with AJAX)?
- problem when adding wp_editor with ajax [duplicate]
- Can’t update WP Editor after Ajax
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Show spinner GIF during an $http request in AngularJS?
- ASP.NET MVC controller actions that return JSON or partial html
- How to check if I am in admin-ajax.php?
- How to get the input of a TinyMCE editor when using on the front-end?
- Ajax in a settings page (update_option is undefined)
- admin-ajax.php vs Custom Page Template for Ajax Requests
- How to use the new Dashicons for custom TinyMCE buttons?
- Is there a hook that fires before an ajax call?
- AJAX request from Chrome Extension to WordPress Website
- How to correctly load wordpress in a non WP script for AJAX request
- Remove quicktag buttons but not Visual / Text editor and tabs
- Minimal WordPress load for only `get_option` to work (because ajax…)
- Why is admin ajax reloading my page
- Admin Ajax always return 0 on form submit
- Why this plugin doesn’t work with media upload page?
- CPU usage: AJAX and Heartbeat API on admin pages
- Add table controls with wp_editor minimal editor configuration (‘teeny’)
- Solve cors problem using rest api or ajax
- Can part of my WordPress website be headless?
- Nonces, AJAX, script variables & security in WordPress
- Why does WordPress Heartbeat login not refresh the nonces?
- Disable HTML (Text) Tab in Post Editor
- Why would admin-ajax.php redirect to the home page for logged out users?
- Admin Ajax and HTML5 Formdata
- Implementing an AJAX POST API call in wordpress
- Identical wp_rest nonce returned from rest_api
- Ajax WordPress Login needs to be stayed in current page Url without redirecting
- wp_handle_upload returns empty error array
- Loading comments in ajax – comment-reply function missing $args
- Woocommerce update product price via AJAX
- How do I query posts by a sub value with the API?
- Popup or admin/update notice on post/page edit screen without page refresh
- Enqueue script in plugin is not working
- Single page site + pushState?
- Interim-Login form on frontend
- Ajax call does not work for this simple code
- WordPress ajax call returns a zero though die()
- Ajax insert or update data
- Check ajax triggered from front-end or from dashboard
- Localize script not working
- Add Ajax to rating button
- Why, if a function accepts arguments, it fails on ajax calls?
- How to disable drag-and-drop upload function in Media Library?
- Stop editor from adding “amp;” after every “&”
- WP_query offset seems to be counting draft post – AJAX load more
- Can’t retrieve any content from Ajax-loaded page
- adding ajax load more to display images from meta box
- Can’t load search results with ajax
- wp_ajax is not calling the action
- Deny dashboard access breaks ajax requests
- Run javascript upon successfully set featured image
- update_option in WordPress AJAX
- How to load dynamic option with ajax
- Auto-suggest to display meta-data, but not to include it upon click
- Register Template
- WordPress responds to the ajax request with readyState 1, 2, 3 before responding with 4
- Filter images from media library by guid meta field
- Counting Posts with multiple taxonomy and terms condition using MySQL and AJAX
- Refresh Gutenberg with JS for it show updated post
- How to Object.freeze wp_localize_script
- WordPress New Post via ajax call
- 400 Bad Request getting on AJAX Call
- How to add Ajax to this Pagination i made?
- Adding user using admin ajax by a user with custom role
- How can I run two AJAX requests simultaneously in WordPress?
- Ajax call not working anymore
- Ajax global variable is not getting saved (returns null)
- WP admin ajax Pagination issue
- Adding a class to custom TinyMCE button using WPLinks dialog box
- Why function called by admin-ajax executes synchronously?
- Can Ajax Action [add_action(‘wp_ajax_{action_name}’, ‘{action_name}’] be hooked into wp hook
- Strange AJAX problem (SOMETIMES works in Chrome/FF, ALWAYS works in Midori)
- Get Page Type (Category/Tag) Using AJAX
- Ajax Form data is not posted back to the get_results()
- Loads posts of different year via AJAX call
- Remove dashboard access but allow ajax file upload
- fail to load /wp-admin/admin-ajax.php locally
- BBPress AJAX problem
- Ajax object comes back empty
- How to get data with Select AJAX PHP
- Add “load more” functionality to an AJAX response
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- weird Internal Server Error – no error log produced