Having problems passing a variable.
This script has worked for the past 8 months or so just fine, but as of last Friday the var hs1 is not being passed from the setInterval() function in start_getspot() to getspot().
When keeping an eye on things with the Developer tools in Chrome, I keep getting the error:
"Uncaught ReferenceError: hs1 is not defined"
Which is obviously being caused by hs1 not being passed to the getspot() function.
It would seem that my syntax in the setInterval() function is wrong, and not passing or defining hs1. But this has worked for sooooo long with no issues?!?!?!?
I've inserted several alerts to debug this and have added **** comments **** to show what is going on on the flow of the script....
var spot_interval;
function krpanospot()
{
return document.getElementById("krpanoObject");
};
function getspot(hs1)
{
alert("hs1="+hs1); **** NO ALERT ****
var hs2 = hs1;
var hspot = Number( krpanospot().get("hotspot[hs2].ath") );
var vspot = Number( krpanospot().get("hotspot[hs2].atv") );
//var fov = Number( krpano().get("view.fov") );
document.getElementById("spotath").value = hspot.toFixed(2);
document.getElementById("spotatv").value = vspot.toFixed(2);
// document.getElementById("fov").innerHTML = fov.toFixed(2);
};
function start_getspot(hs)
{
alert("hs="+hs); **** AS EXPECTED ****
var hs1 = hs;
alert("hs1="+hs1); **** AS EXPECTED hs1 IS PASSED AND SHOWS UP IN ALERT ****
spot_interval = setInterval( 'getspot(hs1)', 66 );
};
I backup the entire web-app I'm working on every day, so I have historical snapshots of every phase of development.
So, I've loaded completely historic versions of the system, that definitely worked. But nothing seems to solve this mystery.
I've tried loading in several of the older versions to no avail ( same results ). This is also browser independent since it occurs on Safari, Chrome FF and IE on Mac and Windows.
I've tried backing off the version of FLASH, the version of KRPano, older versions of safari.....
What still is very odd is that this happened out of nowhere. I did not change any of this scripting. Had not updated ANYTHING over the past week or so.