• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

128
Vistas
Javascript parse JSON into table html

I' m trying to display datas from json into a table in html. SO far I have the following.

  • I need help to parse the data in dom

  • at the moment I can't display the datas properly. Specially the

    "1day": { "movement": 0.28, "price": null }

function readTextFile(file, callback) {
  var rawFile = new XMLHttpRequest();
  rawFile.overrideMimeType("application/json");
  rawFile.open("GET", file, true);
  rawFile.onreadystatechange = function() {
    if (rawFile.readyState === 4 && rawFile.status == "200") {
      callback(rawFile.responseText);
    }
  };
  rawFile.send(null);
}

//usage:
readTextFile("popular-feed.json", function(text) {
  var data = JSON.parse(text);
  //console.log(data);

  //SEE HERE

  var obj = JSON.parse(text, function(key, value) {
    console.log(key[1]);
    console.log(value);
  });
});
<div id="name"></div>
<div id="code"></div>
<div id="spread"></div>

about 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda