Passing parameters to bespoke Javascript functions
Jan 05, 2017
By
Stu Hilton
Hi,
I've created a javascript file in the story_content folder, and added the src script line to the story_html5.html file.
In the javascript file, I have a few bespoke functions which require incoming parameters. I know how to use the GetPlayer feature to extract the variable values from Storyline, but I can't seem to pass those values though to the javascript function. Is it possible to pass parameters ? My test functions won't even accept a string passed as a parameter.
For example :
trigger javascript : test1("this is an alert box")
javascript function :
function test1(p_text)
{
window.alert(p_text)
}
Hopefully, someone can help...
Stu
2 Replies
I'd point you to the Javascript Best Practices and the user.js file generated in your story_content folder to help in debugging. In particular note the trigger related functions up top in the user.js file and how (and if) arguments are passed
Thanks Brian.
It turns out the problem was with some javascript I'd copied incorrectly...
This discussion is closed. You can start a new discussion or contact Articulate Support.