Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Source .js file

  • jan.bleimling
  • jan.bleimling's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #229857 by jan.bleimling
Source .js file was created 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:
Code:
<img src="./themes/survey/vanilla/files/logo.png" />

Thats how I reference the .js file, uploaded to the theme folder as well:
Code:
<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.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months 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?

- manual.limesurvey.org/New_Template_System_in_LS3.x/en

Cheers,
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.

Lime-years ahead

Online-surveys for every purse and purpose