The Official {productname} jQuery component integrates {productname} into jQuery projects.
This procedure creates a basic jQuery integration containing a {productname} editor based on our Basic example.
-
Open an HTML file
-
Add an initialization point for {productname}, such as:
<div> <textarea id="tiny"><p>Encoded HTML content</p></textarea> </div>
-
Add the {productname} jQuery init script. The {productname} selector is defined in the jQuery prefix, and any other settings are defined in the object passed to the
tinymcemethod.
To load a {productname} editor similar to the Basic example, add the following code to an empty HTML file. == {productname} in a jQuery UI Dialog To render {productname} instances inside jQuery UI dialogs, add the following code:
// Prevent jQuery UI dialog from blocking focusin
$(document).on('focusin', function(e) {
if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
e.stopImmediatePropagation();
}
});This code is required because jQuery blocks all focusin calls from elements outside the dialog. For a working example, try this {productname} fiddle.