Javascript just not working for me

Nov 16, 2015


I want to use Javascript to perform some mathematical calculations. Specifically I want a slider to show the exponent of its value and act like a logarithmic scale.

However, my scripts fail the moment I use GetVar or SetVar.

var player = GetPlayer();
document.bgColor = "#009900";
var mynewvalue = 10;
document.bgColor = "#990000";

The code above triggers when a slider moves. I'm changing the background colour of the document to help me debug.

When I slide the slider, the background colour of the page turns green so GetPlayer is fine but SetVar isn't.

Because the background colour is changing as expected, I assume the issue must lie with my code.

I can't see anything wrong with my code so I'm hoping somebody with eagle-eyes can spot it for me!

6 Replies
Chris Reynolds

Thanks Christine. I've read that document and appreciate that providing support for Javascript would be a challenge. It's great that the feature is there in the first place!

I think that my issue is due the fact I'm viewing the files locally. Firefox doesn't like the Javascript but IE does. I'm guessing at this stage that Firefox is protecting me against (the risk of) malicious code so next step is to pop it up onto a server and see if the behaviour is remedied.

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