나는 사방이 검색하지만 같은 멋져요에 대한 대답을하지 않았다 PHP 배열을 인코딩 후 1 JSON 객체가 오전 :읽기 JSON 객체
{
"6":{"brand_id":"6","brand_logo":"http:\/\/images.cdn.bigcartel.com\/bigcartel\/account_images\/457974\/max_h-1000+max_w-1000\/tn.jpg","brand_discovered_count":"2","brand_name":"Not Human Clothing","brand_template_id":"3","products":[{"product_id":"9","product_price":"19.99","product_images":"http:\/\/images.cdn.bigcartel.com\/bigcartel\/product_images\/131442291\/-\/blackpom2.jpg"}]},
"7":{"brand_id":"7","brand_logo":"http:\/\/images.cdn.bigcartel.com\/bigcartel\/account_images\/465045\/max_h-1000+max_w-1000\/frontttt.jpeg","brand_discovered_count":"3","brand_name":"Trill LOVE","brand_template_id":"2","products":[{"product_id":"11","product_price":"49.99","product_images":"http:\/\/images.cdn.bigcartel.com\/bigcartel\/product_images\/134025228\/-\/l3.jpeg"}]}
}
어떻게 내가 아약스
에서 자바 스크립트에서이를 읽을 수 있습니다$.ajax({
type:'POST',
dataType: 'json',
data: 'var1=' + var1,
url:'myurl',
success:function(response){
alert(response);
},
error:function(e){
alert('Error:' +e);
}
});
[JavaScript에서 JSON을 구문 분석하는 방법] 가능한 복제본 (http://stackoverflow.com/questions/4935632/how-to-parse-json-in-javascript) –