Diablo® III

Issues with JSON information and Parsing...

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?
Edited by DrWho#1459 on 9/24/2012 10:45 AM PDT
Reply Quote
Web & Mobile Team
This sounds really specific to the parser you are using.
Reply Quote
09/24/2012 10:51 AMPosted by Straton
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."
}
Reply Quote
Web & Mobile Team
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?
Reply Quote
I figured it out. Apparently "Bastion's Keep" will trigger errors if not escaped for the single quote mark.

However, now when I try to access a hero profile, I get this:

{"reason":"The application is in limited mode.","code":"LIMITED"}
Reply Quote
Web & Mobile Team
For which battletag?
Reply Quote
09/25/2012 04:06 PMPosted by Straton
For which battletag?


This account I am posting from
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]