Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

93
Vistas
filename in JSON

Below are the file location and loading of each of the CSS and JS filename.

<link href="css/default.css" rel="stylesheet" />
<script src="js/main.js"></script>

In XML the filename is entered as such?

let data = "";
let url = 'xml/emailtext.xml';
fetch(url).then(response => response.text()).then(data => {
    let parser = new DOMParser();
    let doc = parser.parseFromString(data, 'application/xml');
});

In JSON?

let strfy = JSON.Stringify('json/file.json');
let json1 = JSON.parse('strfy');
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

When reading a json file, you can read the stream with response.json() instead of response.text(). It returns a promise that will resolve to a javascript object or array if the file contains valid json.

fetch('https://jsonplaceholder.typicode.com/todos/1')
  .then(response => response.json())
  .then((obj)=>
  {
    console.log(typeof obj); // object (not json anymore)
    console.log(obj);
  });

obj above is not json; by then it has already been parsed into a javascript object.

about 4 years ago · Juan Pablo Isaza Denunciar
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda