PJ said:
Can someone tell me why this works on IE Mac:
uniqueId = (new Date()).getTime() % 10000000;
but this doesn't????
var uniqueId = (new Date()).getTime() % 10000000;
Other instances of the var keyword do not have issues? What gives? TIA~ PJ
What do you mean by "works".
If you put the line:
alert(uniqueId);
after both of those, you'll see that they both assign values.
Maybe you don't realize that the "var" keyword makes the variable
local to the function in which it is declared, which means that
it won't be available elsewhere.
The alerts may also show you that, despite being measured in
milliseconds, the clock that drives Date() isn't really updated
that often.