Loading script in Editor template just one time

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


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 (    




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