Im retrieving a Json dataset and need to build a javascript array called 'arrProducts'. My code below is wrong but on the right lines. Can anybody help??
var allProducts = $.get("http://localhost:8888/web/app_dev.php/api/v1/search/search.json",
function(data) {
var productsArray = data.products;
var arrProducts = '';
$.each(productsArray, function(index, product) {
arrProducts['name'] = product.name;
arrProducts['title'] = product.title;
arrProducts['price'] = product.price;
});
});
"at the end of your URLarrProductsdifferent thandata.products?