javascript - jQuery array object getting value -



javascript - jQuery array object getting value -

hey have next code:

var items = []; $(xml).find("placemark").each(function () { var tmp_latlng = $(this).find("coordinates").text(); tmp_latlng = tmp_latlng.split(","); items.push({ name: $(this).find("name").text(), snippet: $(this).find("snippet").text(), description: $(this).find("description").text(), lat: tmp_latlng[0], lng: tmp_latlng[1], distance: $(this).find("distance").text() }); }); var markernodes = items; if (markernodes.length > 0) { howmanymarkers = markernodes.length; (var = 0; < markernodes.length; i++) { console.log(markernodes[i].snippet); var name = markernodes[i].getattribute("snippet"); var address = markernodes[i].getattribute("snippet"); var description = markernodes[i].getattribute("description"); var distance = parsefloat(markernodes[i].getattribute("distance")); var latlng = new google.maps.latlng(parsefloat(markernodes[i].getattribute("lat")), parsefloat(markernodes[i].getattribute("lng"))); createoption(name, distance, i); createmarker(latlng, name, address); bounds.extend(latlng); } map.fitbounds(bounds); } else { alert('sorry, there no stores close location. seek expanding search radius.'); }

the error on console.log(markernodes[i].snippet);. error uncaught typeerror: undefined not function

also markernodes[i].getattribute("snippet") has error of uncaught typeerror: undefined not function

what missing?

javascript case sensitive. property snippet lowercase, use

console.log(markernodes[i].snippet);

javascript jquery arrays xml parsing

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -