javascript - Jquery parseJSON failing - "unexpected token o" -
javascript - Jquery parseJSON failing - "unexpected token o" -
this question has reply here:
i maintain getting “uncaught syntaxerror: unexpected token o” 8 answersi'd simple ajax request json info , parse it. code using follows:
$.get('/ajax/search/dsb.json', function (data) { searchdata=$.parsejson(data); });
i getting error: "unexpected token o." have verified file in question valid json. have googled reply - problem passing javascript object json parser, redundant. however, i'm not sure problem in case. thoughts?
here's json, can check yourselves if it's valid (it is).
{ "numcols": 2, "colnames": [ "disability level", "region" ], "colwidths": [ 200, null ], "colfilters": [ [ "", "all disability types", "not disabled", "significantly disabled" ], [ "", "all regions", "east region", "north central region", "south central region", "west region" ] ], "table": [ [ "significantly disabled", "north central region", 1000013 ], [ "not disabled", "all regions", 1000006 ], [ "significantly disabled", "all regions", 1000011 ], [ "significantly disabled", "west region", 1000012 ], [ "all disability level", "west region", 1000002 ], [ "all disability level", "south central region", 1000004 ], [ "not disabled", "south central region", 1000009 ], [ "all disability level", "all regions", 1000001 ], [ "not disabled", "west region", 1000007 ], [ "significantly disabled", "east region", 1000015 ], [ "not disabled", "east region", 1000010 ], [ "all disability level", "east region", 1000005 ], [ "significantly disabled", "south central region", 1000014 ], [ "all disability level", "north central region", 1000003 ], [ "not disabled", "north central region", 1000008 ] ], "names": [ [ 1000013, "significantly disabled participants in north central region" ], [ 1000006, "not disabled participants in regions" ], [ 1000011, "significantly disabled participants in regions" ], [ 1000012, "significantly disabled participants in west region" ], [ 1000002, "all disability level participants in west region" ], [ 1000004, "all disability level participants in south central region" ], [ 1000009, "not disabled participants in south central region" ], [ 1000001, "all disability level participants in regions" ], [ 1000007, "not disabled participants in west region" ], [ 1000015, "significantly disabled participants in east region" ], [ 1000010, "not disabled participants in east region" ], [ 1000005, "all disability level participants in east region" ], [ 1000014, "significantly disabled participants in south central region" ], [ 1000003, "all disability level participants in north central region" ], [ 1000008, "not disabled participants in north central region" ] ] }
remove .parsejson(data)
function info type json
if joson string format function not worked illustration json type json , not string if utilize parsejson(data)
returned function error function
worket json string
javascript jquery ajax json
Comments
Post a Comment