jsonp - Is this a valid JSON object? -
is valid json-object?
serverstatus("amerika": [{ "server": "1", "ah_gold": "1", "ah_hardcore": "1", "ah_usd": "0", "ah_aud": "0", "ah_mxn": "0", "ah_brl": "0", "ah_clp": "0", "ah_ars": "0" }], "asien": [{ "server": "1", "ah_gold": "1", "ah_hardcore": "1" }], "europa": [{ "server": "1", "ah_gold": "1", "ah_hardcore": "1", "ah_eur": "0", "ah_gbp": "0", "ah_rub": "0" }]) jsonp-request done successfully, in javascript
var server = data.asien[0].server; fails..
solutions this?
you lack { @ beginning, , } @ end :
serverstatus({"amerika":[{"server":"1","ah_gold":"1","ah_hardcore":"1","ah_usd":"0","ah_aud":"0","ah_mxn":"0","ah_brl":"0","ah_clp":"0","ah_ars":"0"}],"asien":[{"server":"1","ah_gold":"1","ah_hardcore":"1"}],"europa":[{"server":"1","ah_gold":"1","ah_hardcore":"1","ah_eur":"0","ah_gbp":"0","ah_rub":"0"}]}) and if you're interested in numbers, don't put them between quotes, that's useless.
the simplest test object open chrome developer tools , type
console.log(... object here ...)
Comments
Post a Comment