更新时间:2023-01-16 19:50:34
如果您没有'['
和']'
字符,则您的字符串不是有效的JSON.
Your string isn't valid JSON if you don't have the '['
and ']'
characters.
您可以在中添加它们,然后使用 jQuery.parseJSON()
[ docs] 方法.
You can add those in , then parse it using the jQuery.parseJSON()
[docs] method.
elements = jQuery.parseJSON( '[' + data + ']' );
...但是***是从服务器发送正确的JSON数据.
...but it would be better if you sent correct JSON data from the server.
此外,您的JSON密钥必须用双引号引起来.
Also, your JSON keys must be wrapped in double quotes.
{"elementid":10},{"elementid":11},{"elementid":12},{"elementid":14},{"elementid":15}