I have a custom content type called 'Visualisation'. I would like a user to be able to upload their own javascript file for each instance of the content type. I would then like to load this script on the page in which the content is displayed.
I have tried adding a custom field 'file', however Drupal doesn't allow javascript files and appends the file with 'txt'. How can I add a javascript file and then load when the content is displayed?
EDIT
As it seems unsafe to achieve this the way I've mentioned above I'll try and elaborate on what I'm trying to do.
The content type is for HTML5 canvas visualisations. Each visualisation will use a custom created script file. The whole content will consist of a title, canvas element, javascript file and description. I therefore need to attach a script to each visualisation.
Would it be better to have a field with just the name of the file and load it in the page template?
Many thanks for any help.