从javascript中的rest api读取json参数时,我不断收到此SyntaxError。
任何线索可能是什么?
我很感激任何帮助
代码:
parseJSONResponse : function(inResult) {
var jsonDoc = JSON.parse(inResult);
this.fmeForm = document.forms['fmeForm'];
ar parameters = jsonDoc.serviceResponse.parameters.parameter;
for( i = 0; i < parameters.length; i++) {
if(parameters[i].type === "LOOKUP_CHOICE") {
this.createComboBox(parameters);
}
if(parameters[i].type === "LISTBOX_ENCODED") {
this.createCheckboxGroup(parameters);
}
}
},
其余的 json 看起来像这样:
"serviceResponse": {
"parameters": {"parameter": [
{
"optionsType": "MULTICHOICE_CONFIG",
"type": "LISTBOX_ENCODED",
"options": {"option": [
{"value": "NOR"},
{"value": "NOR_roads"}
]}
},
{
"optionsType": "SINGLECHOICE_CONFIG",
"type": "LOOKUP_CHOICE",
"options": {"option": [
{
"displayAlias": "WGS84, Lat-Long; Degrees [LL84]",
"value": "EPSG:4326"
}
]}
},
{
"name": "GEOM",
"description": "",
"defaultValue": "<lt>?xml<space>version=<quote>1.0<quote><space>encoding= <quote>US_ASCII<quote><space>standalone=<quote>no<quote><space>?<gt><lt>geometry<gt> <lt>polygon<gt><lt>line<gt><lt>coord<space>x=<quote>-124<quote><space>y=<quote>48<quote><solidus><gt><lt>coord<space>x=<quote>-124<quote><space>y=<quote>49.399999999999999<quote><solidus><gt><lt><solidus>line<gt><lt><solidus>polygon<gt><lt><solidus>geometry<gt>",
"optionsType": "SINGLECHOICE_CONFIG",
"type": "GEOMETRY",
"options": {"option": {"value": "GEOM"}}
},
谢谢!