Source .js file

6 months 4 weeks ago #229857 by jan.bleimling
Please help us help you and fill where relevant:
Your LimeSurvey version:  3.27.24+211108
Own server or LimeSurvey hosting: Own server
Survey theme/template: Vanilla (extended)
Hey there!

I'm trying to add a javascript file to the source code of a question. Leaving the script as a whole in the question's source code works, but by uploading it to for example the theme's files and referencing renders it not working. What am I doing wrong? Referencing the LS logo for instance works.

Thats how I reference the working image in the theme folder:
<img src="./themes/survey/vanilla/files/logo.png" />

Thats how I reference the .js file, uploaded to the theme folder as well:
<script type="text/javascript" src="./themes/survey/vanilla/files/custom_table.js"></script>

The .js file contains some javascript and jquery code to add datepickers and radiobuttons to a "vanilla" text input array. Without sourcing it out, it is working fine.

Thanks to anyone taking the time to answer my question! I look a lot into this forum and some times the answers were really helpful :)

Please Log in to join the conversation.

6 months 4 weeks ago #229870 by tpartner
Replied by tpartner on topic Source .js file
Why not extend the theme and place your JS in the custom.js file?


Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now