Skip to content
Advertisement

JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 50 of the JSON data

when i use….

JavaScript

i get an error => “JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 50 of the JSON data”

this is my JSON data from a php script

JavaScript

Can some please help?…. Thanks

Advertisement

Answer

it’s not a valid json, you must wrap it in array. the valid json is like this

JavaScript

take a look at the bracket [ ] at the start and the end of string , and the , to split the object.

this some online json linter here to check if your json is valid.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement