You are trying to parse something that is not a string. This will implicitly call toString
on the object, and you get the string [object Object]
, which is not valid JSON.
Either parse a string:
newStr = '{"total":"1","page":"1","records":"2","rows":["<li>a</li>", "<li>b</li>"]}';
jQuery("#list").addJSONData(JSON.parse(newStr));
or use the object:
newStr = { total:"1", page:"1", records:"2", rows: ["<li>a</li>", "<li>b</li>"] };
jQuery("#list").addJSONData(newStr);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…