
I'm trying to extract a die roll from a chat window with the following sendChat('', rollStr, function(r) { // sendChat('massinit', 'roll result ="'+r[0].content+'"<br>'); var roll = JSON.parse(r[0].content); // sendChat('massinit', 'roll components ="'+Object.keys(roll)+'"<br>'); // initVal = String(roll.total); initVal = roll.total; }); // end sendChat with callback I have managed to confirm that the JSON-created 'roll' object does in fact possess 'total' as one of its top-level keys (via the second commented-out sendChat()), but initVal persists in remaining 'undefined' when I try to assign it the value from roll.total. What am I missing here? Thanks in advance, Bill