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

116
Vistas
Problem displaying document.body.innerHTML.replace

I add document.body.innerHTML to the page, but the results are displayed incorrectly in the inspect element!

I will add this code:

document.body.innerHTML = document.body.innerHTML.replace(/xxxxxxx/g, 'sssssssssss');

https://i.stack.imgur.com/cmcIW.png

But in the inspect element it shows this code:

document.body.innerHTML = document.body.innerHTML.replace(/sssssssssss/g, 'sssssssssss');

inspect element

Why does this happen?

I use datatables to display in the table, but I want to change the column title to another language

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is happening because the script is inside the body, so as a result, it is replacing all of that content in the script too. What you could do, is, put all of the front-end contents into a div element with a specific id. Then, get the innerHTML of that div, and it should work.

Have a good day!

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