84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
data:{"name":"xxx","age":23}
类似这样的字符串如何转成json
由于key不带双引号,不能直接转
但是如果给data加上双引号,如何split字符串?
用:分隔会造成{"name":"xxx","age":23}也被分隔。
json conversion problem? - PHP Chinese website Q&A - json conversion problem? - PHP Chinese website Q&A
Take a look around and learn.
var a = 'data:{"name":"xxx","age":123}'; //这步可以取到“{"name":"xxx","age":123}” var b = a.substring(a.indexOf("{"),a.lastIndexOf("}")+1); var c = $.parseJson(b);
如果你必须要这个data在外包裹json数据的化,可以这样:
var d = {}; d.data = c;
json conversion problem? - PHP Chinese website Q&A - json conversion problem? - PHP Chinese website Q&A
Take a look around and learn.
如果你必须要这个data在外包裹json数据的化,可以这样: