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

121
Vistas
Edit Downloaded JSON file (React)

I have a button on my webpage, that downloads a JSON file. I want to modify this JSON file to have a few more characters at the beginning and at the end.

How is it possible? This is the code I wrote:

const downloadJSON = (json) => {
 const begin = `beginning: `;
  const end = `\nTheEnd`;
  const jsonStringFile = `data:text/json;chatset=utf-8,${encodeURIComponent(
    JSON.stringify(json),
  )}`;
  const jsonString = begin + jsonStringFile + end; // what I tried
  const link = document.createElement('a');
  link.href = jsonString;
  link.download = 'correctionSummary.json';

  link.click();
};
about 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda