Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Live table update using AJAX


Fotiman - 5:55 pm on May 29, 2012 (gmt 0)


Your condition is testing:
html.inn
Whereas you're using just "inn" in the output. I suspect html.inn is undefined. :)

Also, I was going to make one more suggestion. Instead of passing "Balance: £" in your JSON data, append it with your JavaScript instead. In other words, keep your array simple:

$arr = array("balance" => number_format($balance,2), "class" => $colour);

Then append it in the JavaScript like so:

$("#balance").html("Balance: £" + html.balance);


Thread source:: http://www.webmasterworld.com/javascript/4456322.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com