Today, using JS to convert a $. Parsejson string to a JSON object will report an unexpected syntax error – unexpected token o in JSON at position 1. I couldn’t find the reason. After the ferry, I saw a sentence: there are strict requirements for JSON to convert objects into strings and store them locally, such as symbols or illegal strings, which may affect the later JOSN.parse The analysis of…
Change {type ‘:’name’} to {type ‘,’name’} and solve the problem
That’s right, JSON is sensitive to single and double quotation marks of strings, which leads to the single quotation mark in the real {} that reported the error…
****Replace single quotation marks with double quotation marks
var_ nstr = _ adrdata.replace (/’/g, ‘”’);
Read More:
- Error: syntax error – unexpected token P in JSON at position 0
- Unexpected token u in JSON at position 0
- Error resolution of unexpected token in JSON at position 0
- JS error: unexpected token u in JSON at position 0
- [system]SyntaxError: Unexpected token u in JSON at position 0
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Unexpected token appears in JS
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- Unable to read workspace file ‘D:\angular.json‘: Invalid JSON character: “ “ at
- Syntax error: unexpected token in uni app project compilation
- Strange exception 001: invalid or unexpected token
- Visual slam Lesson 6: curve fitting with g2o, error: cmake error at CMakeList.txt (find_ package) By not providing“FindG2O.cmake“
- Unexpected syntax error: unexpected token<
- ERROR in static/js/app.xxxxxxx.js from UglifyJs Unexpected token: operator (>)
- Shell script syntax error near unexpected token ‘$’Do
- Parsing error: Unexpected token
- Solve the problem of syntax error: unexpected end of file or syntax error near unexpected token ` fi ‘error
- Uncaught syntax error: unexpected token ‘< 0‘
- Syntax error near unexpected token `newline’script cannot be executed
- Module build failed: SyntaxError: Unexpected token