Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:45:33+00:00 2026-06-14T08:45:33+00:00

The Scenario: I need to load up an external page and apply tinyMCE to

  • 0

The Scenario:
I need to load up an external page and apply tinyMCE to the text area

The Issue:
On first click it works, however when you close the dialog and click the button again it doesn’t engage tinyMCE

The Code: test.html

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css" id="theme">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/tiny_mce/jquery.tinymce.js"></script>

<script type="text/javascript">
$(function(){
    $('.newbutton').button({icons: {primary: "ui-icon-plusthick"}}).click(function(e){
        e.preventDefault();
//      $('body').css({'overflow' : 'hidden'});
        $('#newform').dialog({
            show: "puff",  
            hide: "puff", 
            resizable: false, 
            height: 500, 
            width: 800, 
            modal: true, 
            beforeClose: function(){
                if ($("textarea.tinymce").length) {
                    $('textarea.tinymce').tinymce().remove();
                };
                $(this).html(" ");

            }, 
            close: function(){
//              $('body').css({'overflow' : 'auto'});   
                $(this).html(" ");
//              $('#newform').dialog('destroy');
            }, 
            open: function(){
                $('#newform').load("test2.html", function(){
                    $('textarea.tinymce').tinymce({
                        // Location of TinyMCE script
                        script_url : 'js/tiny_mce/tiny_mce.js',

                        // General options
                        theme : "advanced",
                        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

                        // Theme options
                        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
                        theme_advanced_toolbar_location : "top",
                        theme_advanced_toolbar_align : "left",
                        theme_advanced_statusbar_location : "bottom",
                        theme_advanced_resizing : true

                    });
                });
            }
        });     

    });

});
</script>

</head>

<body>
<button id="newbutton" class="newbutton">New</button>
<div id="newform" class="hide" title="Title"><!-- data loaded dynamically--></div>

</body>
</html>

The Code: test2.html

<textarea class="tinymce" id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
                &lt;p&gt;
                    This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
                &lt;/p&gt;
                &lt;p&gt;
                Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
                &lt;/p&gt;
            </textarea>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:45:34+00:00Added an answer on June 14, 2026 at 8:45 am

    After much trial and error I found the issue was because the dialog had a show and hide effect! removing these made the system work, so a work around for this was to show a loading screen while tinymce was initilizing.

    Code test.html :

    Untitled Document

    <script type="text/javascript">
    $(function(){
        $('.newbutton').button({icons: {primary: "ui-icon-plusthick"}}).click(function(e){
            e.preventDefault();
            $('body').css({'overflow' : 'hidden'});
            $('#newform').dialog({
                show: "puff",  
                hide: "puff", 
                resizable: false, 
                height: 500, 
                width: 800, 
                modal: true, 
                beforeClose: function(){
                    if ($("textarea.tinymce").length) {
                        $('textarea.tinymce').tinymce().remove();
                    };
                    $(this).html(" ");
                }, 
                close: function(){
                    $('body').css({'overflow' : 'auto'});   
                    $(this).html(" ");
                    $('#newform').dialog('destroy');
                }, 
                open: function(){
                    $('#newform').load("test2.html", function(){
                        $(this).css({"overflow": "hidden"});
                        $('.tinymceloader').css({"position": "absolute", "height": $(this).height()-16, "width": $(this).width() - 32, "z-index": 200, "background-color": "#ffffff"});
                        setTimeout("inittinymce(); $(this).css({\"overflow\": \"auto\"});", 500);
                    });
                }
            });     
    
        });
    
    });
    function inittinymce(){
        $('textarea.tinymce').tinymce({
                            // Location of TinyMCE script
                            script_url : 'js/tiny_mce/tiny_mce.js',
    
                            // General options
                            theme : "advanced",
                            plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
    
                            // Theme options
                            theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
                            theme_advanced_toolbar_location : "top",
                            theme_advanced_toolbar_align : "left",
                            theme_advanced_statusbar_location : "bottom",
                            theme_advanced_resizing : true
    
                        });
        setTimeout("$('.tinymceloader').hide();", 1000);
    
    }
    </script>
    
    </head>
    
    <body>
    <button id="newbutton" class="newbutton">New</button>
    <div id="newform" class="hide" title="Title"><!-- data loaded dynamically--></div>
    
    </body>
    </html>
    

    Code test2.html:

    <div class="tinymceloader">Loading</div>
    <textarea class="tinymce" id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
                    &lt;p&gt;
                        This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
                    &lt;/p&gt;
                    &lt;p&gt;
                    Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
                    &lt;/p&gt;
                </textarea>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The basic scenario is this: I need to load text from a database, and
I have a scenario where I need to load properties from database or java
I have a scenario where I need to show a different page to a
I have business scenario as source files (text files) comes to load into SQL
i am working on a scenerio where i need to load 3 csv files
Scenario : You need to expose the same app on different screens - let's
Here's my scenario: I need to make three or four calls to different WCF
I have: Textbox(Multi-line) Panel Different controls inside panel (buttons,textbox) Scenario: I need to add
I am a complete beginner to Qt. In a test scenario I need to
I have scenario where I need to host a web service (WCF) on Azure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.