Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

91
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda