HTML5 JavaScript support

May 10, 2012

I read that JavaScript has "limited support" when publishing to HTML5. And it seems that js I create is indeed not getting loaded in HTML5. 

Are there any guidelines or tips as to what JS works in HTML5?

Thanks

James

20 Replies
Dave Mozealous

Hey James,

Currently we don't support the Get and Set functions like the Flash player does with JavaScript triggers, but simple things like alerts should work.  In one of the sample courses I have a trigger to Execute JavaScript when the user clicks the next button if a variable is less than 4.  That JS is set to:

window.alert('You must explore all areas before proceeding.')

We are going to look at adding better support for JS in the HTML5 version as we go along, but right now really only basic stuff is going to work.

-Dave
John Hauschildt

Can you execute functions from previously included JS files? I know that Email Results is no longer supported in Storyline, but the EmailResults function is still included in the story.js script file. In QM, we hacked the corresponding function (near line 450 in the quiz.js file, I believe) to post the results to a script on an application server in order to update our databases.

I would hope that using the Execute Javascript action in the Trigger Wizard might allow us to execute the EmailResults function in a similarly hacked story.js file so we can extract basic data. Perhaps even from a Results Slide without needing a quiz? The inability to extract even basic data from Storyline is currently our biggest stumbling block in moving ahead with it.

onEnterFrame (James Kingsley)

Dave Mozealous said:

Hey James,

Currently we don't support the Get and Set functions like the Flash player does with JavaScript triggers, but simple things like alerts should work.  In one of the sample courses I have a trigger to Execute JavaScript when the user clicks the next button if a variable is less than 4.  That JS is set to:

window.alert('You must explore all areas before proceeding.')


Dave, That alert works for you when you run the story_html5.html? 

Cause I can not get any JavaScript to run in html5... 

Chris Fletcher

John Hauschildt said:

Can you execute functions from previously included JS files? I know that Email Results is no longer supported in Storyline, but the EmailResults function is still included in the story.js script file. In QM, we hacked the corresponding function (near line 450 in the quiz.js file, I believe) to post the results to a script on an application server in order to update our databases.

I would hope that using the Execute Javascript action in the Trigger Wizard might allow us to execute the EmailResults function in a similarly hacked story.js file so we can extract basic data. Perhaps even from a Results Slide without needing a quiz? The inability to extract even basic data from Storyline is currently our biggest stumbling block in moving ahead with it.


John, I've been looking for a way to do this myself and have found a workaround using the execute javascript window. I posted about it on a different thread today:

http://community.articulate.com/forums/p/12738/86871.aspx#86871

Hope it helps. All I've had to do is amend my asp file so that it reads variables posted into the url from the javascript rather than reading from a submitted form.

Chris

Funda Yanc

Hi there,

I want to create one course with 3 sections. Each section should have its own status in moodle. When I finish section 1, section 1 should go 100% on the course overview in moodle. section 2 and section 3 should stay at 0%.

What would be the easiest way?

I can imagine to put triggers at the end of each section calling the bookmark function of the scorm api and setting the students status to 100%. But I don t know how to tell storyline to handle each section as a unit.

Thanks for any reply in advance!

Funda Yanc

Hi James,

thanks for your reply. I copied the Storyline output files of each section into one single folder and edited the imsmanifest.xml there. This worked for me. I have another issue. When I did not complete the section there is nothing in the status field. I would like to have the status "incomplete". Is this something I can set up in Storyline?

This discussion is closed. You can start a new discussion or contact Articulate Support.