I'm confused as to how I could seperate out the functionality of a plugin I am writing into multiple javascript files in the plugin directory. Can anyone help me? I have tried some document.write stuff but haven't had any luck yet. Thanks in advance
Thu, 01/22/2009 - 10:40
#1

Re: Multiple javascript file plugin
var base = FCKConfig.PluginsPath + 'RealiseIT/'; document.write('<script src="'+base+'fileToInclude.js"></script>');Re: Multiple javascript file plugin
var tempNode = document.createElement('script'); tempNode.type = 'text/javascript'; tempNode.src = 'path/to/yourscript.js'; document.getElementsByTagName('head')[0].appendChild(tempNode);But to wait with proceeding until the script is loaded, you'll have to check on, for example, a variable that is created in the included script in a iterating timeout...