Loading script in Editor template just one time

Topics: Writing modules
Dec 5, 2012 at 1:00 PM
Edited Dec 5, 2012 at 6:33 PM

Hi

I wrote a module which requires a javascript file from an external url.

Now i just placed it in the Editortemplate, so technically, if i use my module (it's a content field) two times on a content type, it would load the script two times...

 

How can i pretend that, so that it just loads the script one time? Is there something like a Document.cshtml for modules?

i cannot use script.include() because the script reference needs a special attribute for a data api key (    

 

Thanks

 

EDIT: Got it... worked with the script.include and .setattribute :)