I am currently working on a commodities quotes widget. I have already set up the 'Current' and '24-hour' divs, but I'm facing an issue where positive values are not displaying in green and negatives in red as intended. I have checked my scripting multiple times but can't seem to find the problem.
You can view the code in action here: http://jsfiddle.net/thetuneupguy/r2Bca/17/
var chngClass = '';
var chnginpercentClass = '';
(obj.Change.substr(0,1) == '+') ? chngClass = 'green' : chngClass = 'red';
(obj.Change.substr(0,1) == '+') ? chnginpercentClass = 'green' : chnginpercentClass = 'red';
$lc.append($('<td class="'+chngClass+'">').text(rndchange || "--"));
$lc.append($('<td class="'+chnginpercentClass+'">').text(rndchpercent || "--"));
});