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

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

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 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