Forum Discussion
Can I expect javascript in a Storyline block to function when inserted into Rise?
Our team has an api that will accept information that is output using a javascript trigger in Storyline and bring it into an internal database. This has been tested and functions.
I was hoping to build this course in Rise, not Storyline. Can I expect the javascript trigger to still do its thing once the Storyline file has been created, published to Review 360, and then brought into Rise through a Storyline Block and published from Rise?
- JohnCooper-be3cCommunity Member
We use Storyline blocks in RISE with JavaScript triggers in them quite a lot - so the short answer is Yes...
BUT.... In many cases the JavaScript requires access to code which is included from a JavaScript library (to do things like open a pdf file or access a remote database). There are a number of ways that library can be included in the Storyline published file...
1. It can be accessed using a 'script' which is added to the story.html or index_lms.html file after the Storyline has been published.
2. The JavaScript library code can be loaded into a webobject which is then loaded from a new slide in the Storyline project (see the discussion here for more details):
3. Some of the libraries can be loaded dynamically i.e. you can include a JavaScript command that accesses and loads the library you need at runtime.
Methods 2 and 3 don't require any amendment to the published code - so should work OK when the Storyline is published in a RISE course (we use method 3 and that does work - I can't see any reason method 2 wouldn't work - but I could be wrong!). But if your JavaScript code in the Storyline uses a JavaScript library - which I'm pretty sure it will - and the library is loaded using method 1 then there may be some work to do to get it to work.
Sorry, about the long answer - but you do need to know (a) does your JavaScript use an external library? If yes, then how is that loaded.
Hope that helps
- FionaMacelliCommunity Member
SUCH a helpful answer John, thanks so much!! I wonder if you'd mind connecting with me on LinkedIn or some such so that I could pick your brain about this later when we try? I'm betting there are thousands of John Coopers but my link is here: https://www.linkedin.com/in/fionamacelli/
- SunnyRajCommunity Member
Hi Fiona,
On of the best way to do is , use external weboject to load your API and all other functions then load it in Storyline as external webobject so there won't be any dependency even after you publish to Review Mode.