I have a stdClass object in PHP, something like
stdClass
$o = new stdClass; $o->foo = $bar
The variable $bar contains a
$bar
What I do is to evaluate the json object before assuming its safe. I think the method is evalJSON(true) in prototype and jquery has a similar implementation. I don't know much about xss standards with JSON but this helps me