close
JSON物件:var objArray=[{"t1_id":"1","t1_name":"001","t1_text":"001","t1_fulltext":"001"}];
字串:var data='[{"t1_id":"1","t1_name":"001","t1_text":"001","t1_fulltext":"001"}]';
一、字串轉JSON物件
var data2=JSON.parse(data);
二、JSON物件轉字串
var data= JSON.stringify(objArray);
三、jQuery 分解 JSON 取值
var data2=JSON.parse(data);
var html_1="";
$.each(data2,function(key,value){
html_1=key + ": " + value.t1_id+"- "+value.t1_name+"- "+value.t1_fulltext;
});
全站熱搜
留言列表