Share variables between two different sotryline files using javascript

Mar 06, 2024

Hello.
I'm building a project that will be big, at least big enough to get my computer lagging.
So I would like to divide it into 6 different modules.
And put those modules in 6 different .story
But I have 2 variables that must accompany all modules as they change with course progress.
I have looked, and there's a post here about that, but it is 7 years old, and the examples are still in flash, and I can't see them.
Does anyone know how to do that?
i know it will involve javascript but I don't know how.
If anyone can help would much appreciated.

1 Reply
Sam Hill

Hi Jose, it will depend on how the course is being deployed. There is a solution using cookies, but of course cookies expire and are localised to a device. I have used the cookie technique in the past where two modules would check for a custom cookie (using JavaScript) and set an internal variable value based on the cookie value.