I have created a Hype document where I call a Javascript function to change the inner html of a rectangle to create a UI toggle button based on the name of the img src filename as well as incrementing a counter I use elsewhere.
Everything works fine on desktop browsers and even when I create a webView based iOS application in Xcode
Android, for some reason throws an error. Here is the code:
var whichone = document.getElementById('depc_btn');
var check = whichone.src.includes("pressed");
if (check == true)
{
whichone.src = whichone.src.replace("depcheck_button_pressed.svg", "depcheck_button.svg");
if (count >= 1) {count --;}
}
else if (check == false)
{
whichone.src = whichone.src.replace("depcheck_button.svg", "depcheck_button_pressed.svg");
count ++;
}
document.getElementById('count_txt').innerHTML = count;
The error is thrown before the ‘check’ variable is created. Any ideas?