CKEditor - attach to AJAX loaded content

I have page that has a contenteditable area that has a CKEDitor attached.

what I'm looking to do, is to load another page to replace the current one, that loads in another contenteditable div via AJAX

This works fine, but the loaded content, doesn't have the CKEditor WYSIWYG attached.

<div contenteditable="true" class="content"></div>

 $.ajax({  
  type: "POST",                                    
  url: 'load.php',
  data: "id="+id,                        

  success: function(data)          
  {
     // I've tried using the CKEditor config, but doesn't load
  } 
});

load.php

<div contenteditable="true" class="content"></div>

Answers


For dynamically added elements you need to call CKEDITOR.inline. This method accepts an element (or its id) on which editor should be initialized and config object. See docs.


Need Your Help

How do I invoke changes to a custom view object from its activity

java android view android-activity

I have a custom view that draws to a canvas. I am trying to invoke changes to the canvas when the user pushes a button from the activity that this view is tied to. Currently, I am attempting to d...

jQuery(html, props) not working on an input

jquery dom-manipulation

The jQuery overload for creating an HTML element and supplying a map of properties does not seem to work for controls. I saw in the documentation that IE does not allow you to change the type so you

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.