Forum Discussion
How to add jQuery or anyother external Javascript Library to Storyline
I am attempting to use method 1, above, to add the fuse.js library. Hashing at srihas.org gives this code, which I am then adding to the index.html file just above the </head> tag.
When my script includes the line import Fuse from 'fuse.js' it will not run and console indicates Uncaught SyntaxError: Cannot use import statement outside a module. Changing the line to const Fuse =require('fuse.js'); gives the same error.
Suggestions?
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.5.3" integrity="sha384-TuaUWxocoApLRRbyrqbi39IZ5NEOZ6ukDXzbC/xiyzCe2wADliyXsO42shDI43rf" crossorigin="anonymous"></script>
Hi Andrew,
Import a script might not work in Storyline as Storyline does not use 'Modules' ( that is a method of using external JS libraries ) in its internal code.
Basically said you either need to link to an online minified JS script or download the script and add it as resource in Storyline and use it like that.
Im gonna try and make a simple sample with Fuse.
Kind regards,
Math