0
我有這樣的代碼,我想要轉換爲本機JavaScript。什麼是最好的方法?
$.each(data.results, function (i, val) {
var venueObj = val.venue;
if ((venueObj && venueObj.lat != 0)) {
meetupName.push(val.name);
meetupDescript.push(val.description);
meetupUrl.push(val.event_url);
//meetupLat = [];
meetupLat.push(venueObj['lat']);
//meetupLong = [];
meetupLon.push(venueObj['lon']);
//address
meetupAddress.push(venueObj['address_1'] + "</h3><h3>" + venueObj['city']);
} else {
return;
}
});
'for循環.......'或'data.results.forEach(函數(){//} )' – Rayon
爲循環是最好的主意.. –
我嘗試,但我沒有得到我想要的價值。 – mmativ