I have a code that inserts custom content into tinyMCE. I have used this code as a click function and it worked, so I was wondering how I could make it into something that happens on body load.
Here is the raw code:
tinyMCE.get('elm1').execCommand('mceInsertContent',false,'<? echo $videocode; ?>');return false;
And here is what I’ve tried in an onLoad:
<body onload="tinyMCE.get('elm1').execCommand('mceInsertContent',false,'<? echo $videocode; ?>');return false;">
Currently, the return false part shows up as raw HTML on the page.
It’s better to use
document.onloadinstead of<body onload="">.