当前位置: 代码迷 >> 综合 >> js Uncaught SyntaxError: Unexpected token , in JSON at position 4100 at JSON.parse问题解决
  详细解决方案

js Uncaught SyntaxError: Unexpected token , in JSON at position 4100 at JSON.parse问题解决

热度:27   发布时间:2024-02-07 23:34:30.0

问题描述:

Uncaught SyntaxError: Unexpected token , in JSON at position 4100 at JSON.parse

JSON.Parse()方法使用错误。

问题解决:

有以下几种情况:

1、JSON.parse()方法参数不是string类型。

解决办法:

data = typeof data =='string'?JSON.parse(data):data;

2、JSON.parse()方法参数不符合json格式。

例如:

data='[{"minDateTime": ,"maxDateTime":
}]'

解决办法:

data='[{"minDateTime":"2020-08-01" ,"maxDateTime":"2020-08-07"
}]'
  相关解决方案