Issues with JSON information and Parsing...

#1 - Sept. 24, 2012, 5:29 p.m.
Blizzard Post
So, I can get the JSON info just fine and it is said to be well formed via http://jsonlint.com/.

However, when I use this code in JavaScript:

var jTXT = request.getAttribute("json");
var charaOBJ= eval ("(" + jTXT + ")");


or this:

var jTXT = request.getAttribute("json");
var charaOBJ = JSON.parse(jTXT);


and then reference it via HTML as:

document.getElementById("d3name").innerHTML=charaOBJ.heroes[0].name;


Nothing shows up at all.

UPDATE
So If I delete everything but the 'heroes' objects, it will work. Any ideas on what gives?
Forum Avatar
Web & Mobile Team
#2 - Sept. 24, 2012, 5:51 p.m.
Blizzard Post
This sounds really specific to the parser you are using.
Forum Avatar
Web & Mobile Team
#4 - Sept. 24, 2012, 11:58 p.m.
Blizzard Post
09/24/2012 12:25 PMPosted by DrWho
This sounds really specific to the parser you are using.


I am using the standard/safest way to parse with JSON.parse which looks like this:

var charaOBJ = JSON.parse(jTXT);


Also, when I try any other API's, I get this:

{
"code" : "LIMITED",
"reason" : "The application is in limited mode."
}


What happens when you try a different battletag?
Forum Avatar
Web & Mobile Team
#6 - Sept. 25, 2012, 11:06 p.m.
Blizzard Post
For which battletag?