2
我做一个ajax开机自检,并从服务器获取这个日期再(我有服务器的控制权,如果我需要做出改变):字符串转换为JS地图
"[{4e2384d1eca4a61030d8746c:'27.7766405735821,-81.9141438476562,stuff,'},{4e237b32eca4a6103061abf7:'27.94904038727,-82.6213887207031,test again,'}]"
我试图将其转换在地图即
{4e2384d1eca4a61030d8746c:'27.7766405735821,-81.9141438476562,stuff,'}
{4e237b32eca4a6103061abf7:'27.94904038727,-82.6213887207031,test again,'}
在Firebug
,我收到我做的
$.parseJSON(txt) //where txt is the data received
手表的数据,但我得到一个错误
Invalid JSON:
[{4e2384d1eca4a61030d8746c:'27 0.7766405735821,-81.9141438476562,东西, '},{4e237b32eca4a6103061abf7:'27 0.94904038727,-82.6213887207031,再次测试 ,'}]
TIA
很明显,你没有创建适当的JSON ...有什么问题吗? –