V
vunet.us
Hello,
I am installing TinyMCE on my app. TinyMCE is a free HTML editor.
Initializations goes well when I include one JavaScript file and add
initialization code inside of HTML page, something like this:
<script language="javascript" type="text/javascript"
src="tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({....});
function myCustomExecCommandHandler(){...}
function customSave(id, content) {...}
</script>
However, my html textarea element, where tinyMCE object gets reference
to is invisible on thepage until user calls it to be visible with
display:block;. Therefore, I wanted to call the code above when it is
needed to initialize tinyMCE object. So I put javascript code into one
more remote file and call all two files upon request with similar
function:
function tinyMCEOnDemand(){
var head = document.getElementsByTagName("head")[0];
var script = document.createElement('script');
script.id = 'tinyMCEScriptInitializer';
script.type = 'text/javascript';
script.src = "tinyInit.js";
head.appendChild(script);
}
The problem is that tinyMCE is either undefined or does not have
properties (depends on which order of two requested files is used). I
do not know what exactly to ask but perhaps, you can share your idea
of how to initialize the object (tinyMCE) applied to an invisible
element or just any other thoughts?
Thank you
I am installing TinyMCE on my app. TinyMCE is a free HTML editor.
Initializations goes well when I include one JavaScript file and add
initialization code inside of HTML page, something like this:
<script language="javascript" type="text/javascript"
src="tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({....});
function myCustomExecCommandHandler(){...}
function customSave(id, content) {...}
</script>
However, my html textarea element, where tinyMCE object gets reference
to is invisible on thepage until user calls it to be visible with
display:block;. Therefore, I wanted to call the code above when it is
needed to initialize tinyMCE object. So I put javascript code into one
more remote file and call all two files upon request with similar
function:
function tinyMCEOnDemand(){
var head = document.getElementsByTagName("head")[0];
var script = document.createElement('script');
script.id = 'tinyMCEScriptInitializer';
script.type = 'text/javascript';
script.src = "tinyInit.js";
head.appendChild(script);
}
The problem is that tinyMCE is either undefined or does not have
properties (depends on which order of two requested files is used). I
do not know what exactly to ask but perhaps, you can share your idea
of how to initialize the object (tinyMCE) applied to an invisible
element or just any other thoughts?
Thank you