hankknight
asked on
Combine Ajax content loader with editor
This function places 'Hello World' inside my rich text editor (TinyMCE)
function ajaxLoad() {
var ed = tinyMCE.get('elm1');
ed.setContent('Hello World');
}
This line of code places the content of test.php into an empty div
ajax_loadContent('divID',' external/i nfo.php');
How can I combine these, so that I can place the content of test.php into the editor?
This does NOT work:
function ajaxLoad() {
var ed = tinyMCE.get('elm1');
ed.setContent(ajax_loadCon tent(ed,'e xternal/in fo.php'));
}
edit.zip
function ajaxLoad() {
var ed = tinyMCE.get('elm1');
ed.setContent('Hello World');
}
This line of code places the content of test.php into an empty div
ajax_loadContent('divID','
How can I combine these, so that I can place the content of test.php into the editor?
This does NOT work:
function ajaxLoad() {
var ed = tinyMCE.get('elm1');
ed.setContent(ajax_loadCon
}
edit.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, pellep.
Your answer had two parts.
You explained that the content in the editor iframe MUST be reloaded after this is done.
And you explained that the code presumes the content is in a div, not a textarea.
I have asked a related question here:
https://www.experts-exchange.com/questions/23898620/AJAX-Works-with-div-but-not-textarea.html
Your answer had two parts.
You explained that the content in the editor iframe MUST be reloaded after this is done.
And you explained that the code presumes the content is in a div, not a textarea.
I have asked a related question here:
https://www.experts-exchange.com/questions/23898620/AJAX-Works-with-div-but-not-textarea.html
Hi hankknight,
i am in need of the same...can u give me the link from where you got this editor....i to want to load
different values to the editor based on a select ooption uisng ajax
i am in need of the same...can u give me the link from where you got this editor....i to want to load
different values to the editor based on a select ooption uisng ajax
ASKER
whspider, I do not understand what you need. The editor is TinyMCE.
http://tinymce.moxiecode.com/
http://tinymce.moxiecode.com/
Try this and see if it works
Open in new window