Dear Sirs and Madam,
when trying to include json2.js
I am trying to supply additional form-elements with data by ajax. Lastly I simply echoed html_entity_decoded html-code to the ajax handler which sets the contents of the editor, successfully.
Now I want to replace the simple echoing by a JSON formatted string, to get additional form-elements with data supplied,
While trying to decode the information on the client-js-side with:
Is there a way to run json2.js with the "built-in" json of ckeditor in parallel?
If not, could anybody point me how to use ckeditors included json interface to feed the json-string to the individual form-elements , please ?
Hopefully it is clear what I intend to do.
thanks in advance and best regards
dekobas
when trying to include json2.js
CKEDITOR.scriptLoader.load( 'path_to_json2.js' );in the window.onload function the ckeditor is not initializing anymore. When I ommit the inclusion, it works. firebug reports:
T[V].replace is not a functionin while have json2.js included.
I am trying to supply additional form-elements with data by ajax. Lastly I simply echoed html_entity_decoded html-code to the ajax handler which sets the contents of the editor, successfully.
Now I want to replace the simple echoing by a JSON formatted string, to get additional form-elements with data supplied,
$res = $db->get_content_by_id($par[0]); $txstring = json_encode($res,null); echo $txstring;which delivers
[{"id":"4","description":"freizeit->videos","typ":"passage","htmlsnippet":"Olympus LS-20m"}]in the editor.
While trying to decode the information on the client-js-side with:
var data = str.evalJSON();it claims that evalJSON is not found. (since I omitted the inclusion of json2.js.
Is there a way to run json2.js with the "built-in" json of ckeditor in parallel?
If not, could anybody point me how to use ckeditors included json interface to feed the json-string to the individual form-elements , please ?
Hopefully it is clear what I intend to do.
thanks in advance and best regards
dekobas