making an ajax call with CKEDITOR

Subject:

jqeury cannot pickup the texarea input text in the iframe.  CKEDITOR is a pure javascript markup, you will need to use the editor getData method

2014-12-09 22:06:36gstlouis

Retrieving Data from CKEditor

Some applications need to handle all data on the client side, sending it to the server using their specific methods. This is what usually happens in inline editing — with the possibility to create and destroy CKEditor instances dynamically, CKEditor is a perfect match for Ajax applications. If this is the case, it is enough to use the JavaScript API methods to easily retrieve the editor instance data.

To retrieve the editor data, call the CKEDITOR.editor.getData method of the editor instance. For an editor instance with an ID of editor1, this would look like the following:

<script> var data = CKEDITOR.instances.editor1.getData(); // Your code to save "data", usually through Ajax. </script>

gstlouis
vote
2014-12-09 22:06:46

you also need to unicode before you do the ajax call to.
This function encodes special characters
 

Example

Encode a URI:

var uri = "http://w3schools.com/my test.asp?name=ståle&car=saab";
var res = encodeURIComponent(uri);

The result of res will be:

http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab

Definition and Usage

The encodeURIComponent() function encodes a URI component.

This function encodes special characters. In addition, it encodes the following characters: , / ? : @ & = + $ #

Tip: Use the decodeURIComponent() function to decode an encoded URI component.

all browser supported

gstlouis
vote
2014-12-09 22:49:24