Ver Mensaje Individual
  #8 (permalink)  
Antiguo 30/04/2012, 12:23
drakgoku1
(Desactivado)
 
Fecha de Ingreso: agosto-2011
Mensajes: 327
Antigüedad: 12 años, 8 meses
Puntos: 3
Respuesta: No entiendo como hacerlo JSON-Javascript

Lo que tengo es :

<html>
<head>
<script type="text/javascript">

var JSONObject =
[{"id":"0","name":"1 - Gran Via Corts Catalanes, 760","lat":"41397952","lng":"2180042","timestamp": "2012-04-29 14:03:11.118561","bikes":9,"free":13},............ ......}]
</script>

</head>

<body>
<h2 align="center"> Bikes </h2>


<script type="text/javascript">
document.write("<ul>");

for(var i in JSONObject){
var cad = "<p>" +

JSONObject[i].id + " . " +
JSONObject[i].name + " , " +
JSONObject[i].lat+ " , " +
JSONObject[i].lng + " , " +
JSONObject[i].timestamp + " , " +
JSONObject[i].bikes + " , " +
JSONObject[i].free + " . " +
"</p>";
document.write("<li>" + cad + "</li>");
}
document.write("</ul>");
</script>



</body>
</html>



Y visualizo bien toda la información, pero no se sacar la información que quiero .
Como dije anteriormente " EL id más/menos grande, selecciono el id pero muestro el nombre"