All pastes #946666 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-17 21:09 UTC
rendered paste body
Hello, here's my problem, this is the code following an ajax request and the server returns
some JSON definitions (yes, I'm sure the server returns it because I tried with an alert(request.responseText)).
I just don't get it...

...code...
markers=eval( "(" + request.responseText + ")" );
for (var i = 0 ; i < markers.length ; i++) {
  var marker=markers[i].attributes;
  var lat=marker.lat;  //  <--- This line generates the error: marker has no properties
...code...

JSON emitted by the server:

[{"left": "Eiffel", "updated_at": "2008/03/17 15:58:17 -0300", "found": "Tour", "lng": 2.2944259644, "id": 2, "lat": 48.858432882, "created_at": "2008/03/17 15:58:17 -0300"}, {"left": "cd", "updated_at": "2008/03/17 16:58:48 -0300", "found": "ab", "lng": -4.04296875, "id": 3, "lat": 40.3130432089, "created_at": "2008/03/17 16:58:48 -0300"}, {"left": "dsa", "updated_at": "2008/03/17 16:59:41 -0300", "found": "asd", "lng": -0.87890625, "id": 4, "lat": 38.4105582509, "created_at": "2008/03/17 16:59:41 -0300"}]

Any idea please ?