Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How can I install Java script Library into Light house?


I'm new at JS. I need to use the driver.JS to prepare a guide tour.  (https://kamranahmed.info/driver.js/)

thanks for advance,
asked Apr 16 by ahmet.adali (120 points)

1 Answer

0 votes
A JavaScript file can be added to each page of your questionnaire by adding HTML like this to your questionnaire's HTML head tag:

<script src="myfile.js"></script>

In theory, you could put the URL of a .js file in there and be good to go, but I feel hesitant to ship a questionnaire like that just in case something goes wrong with the server hosting that URL.  I prefer to download the .js file to my computer and place it in my questionnaire's graphics folder and then reference it like this:

<script src="[% GraphicsPath() %]myfile.js"></script>

Of course, different libraries may come with different licensing rules.  Be sure to comply with the rules of use for any library you are interested in adding to your questionnaire.
answered Apr 16 by Zachary Platinum Sawtooth Software, Inc. (120,900 points)