SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast pratip's Avatar
    Join Date
    Dec 2009
    Location
    Kolkata, West Bengal, India
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question tiny mce update in ajax

    Hello everybody,

    I'm not able to update a tiny mce text editor content in ajax (using php). Weirdly, if i update any div, it performs perfectly, but not in the case of the editor. I'm confused as to what i'm doing wrong here. Can you guys please help me?

    This is my code...

    Code JavaScript:
    if($("body") && go_url)
    		{
    			tinyMCE.triggerSave();
    			var xmlHttp= new Ajax.Updater("body",go_url,
    			{
    				parameters:Form.serialize('import_but'),
    				onLoading:function(){loading_in();},
    				onLoaded:function(){loading_out();},
    				onComplete:function(request)
    				{
    					if(xmlHttp.responseIsFailure(  ))
    					{
    					    alert('failed');
    					}
    					else
    					{
                            tinyMCE.get('body').setContent(request.responseText);
    					 }
    				}
    			});
    		}

    "body" is the id of the text area (that is converted into the tiny mce instance).
    Again, I tested with a normal, plain div and it worked fine, but not with the editor.

    Am i doing anything wrong???

    Please help...

  2. #2
    SitePoint Enthusiast pratip's Avatar
    Join Date
    Dec 2009
    Location
    Kolkata, West Bengal, India
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never mind, i found out the problem. It's just that the else part of the oncomplete state was not working for some reason. When i place the editor update code outside the if-else checking, it worked.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •