Javascript not working as expected

Aug 28, 2019

We have a requirement to produce simulation questions.
In order for the questions to integrate with our testing platform, the simulation question needs to trigger a javascript to update a variable within our testing platform.
For HTML5 based simulations, the javascript is not working but using this javascript in a flash file it works. Can you help?

Javascript being used

void(document.getElementByld("testing_result").value="1,2,3");

1 Reply
Brian Dennis

I would recommend Zsolt's tutorial on Javascript, and Javascript + Storyline. The javascript you've written is mostly correct javascript inside web browsers. The Storyline world is quick different.

p.s. no need to wrap things in a void call. in fact, i would strongly recommend removing the outer void call to be correct Javascript. Your code currently calls the "void" function, with the return from the assignment operation ("="), which varies between "undefined" and "void" itself across browsers.

 

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