RSS

TinyMCE load ajax

13 Sep

Today I got problem to load TinyMCE as dynamic loaded textareas by Ajax?

Solution:

<a href=”javascript:void(0)” onclick=”ajaxEdit(); showEditor();”>Edit Content</a>

here ajaxEdit() is ajax function where textarea loaded by ajax as html response.

here we have use showEditor(); to load TinyMCE editor … page loaded by Ajax

<script>

function showEditor()
{

setTimeout(“initEditor(‘newsdesc’)”,4000);

}

tinyMCE.init({………………………
…………………………………………………});

function initEditor(id)
{

tinyMCE.execCommand(‘mceAddControl’, false, id);

}

</script>

tiny

 
5 Comments

Posted by on September 13, 2009 in javascript, php, Tips, Tricks, Web Application

 

Tags: ,

5 responses to “TinyMCE load ajax

  1. black hattitude

    October 15, 2009 at 2:36 pm

    Hi,

    thanks for the great quality of your blog, every time i come here, i’m amazed.

    black hattitude.

     
  2. Squamiraizori

    December 12, 2009 at 2:11 am

    Authentic words, some unadulterated words man. You made my day!!

     
  3. superrefman

    December 25, 2009 at 2:12 am

    stunning forum, i wish i found it earlier…

    superrefman

     
  4. Jay

    January 11, 2010 at 3:07 pm

    please.. send complate that script to my email..

     
  5. Rost

    February 4, 2010 at 2:44 pm

    don’t you think, that it would be better to call initEditor(id) in ajax’s onComplete/onSussess ?

     

Leave a reply to Squamiraizori Cancel reply