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

104
Visualizações
DIV Refresh on a Object File

I've created a DIV that loads a text file. The goal is to update the text file and have the output correctly displayed in the browser. It works; however, when I update the text file, the contents do not display in the browser until I do a ctrl-F5 to hard refresh the page.

<div id="outage"><object width=475 data="outage.txt"></object></div>

How can I refresh the DIV or OBJECT to correctly display the data in the text file?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think that's what you mean? Ajax can be used in this process. If you want what has been written in the file to be moved to the 'div' immediately after the 'save' then I don't think it's possible to do it except by back-end

<div id="outage">
  <object width=475 data="outage.txt"></object>
</div>
<button class="bttn">Update</button>

<script>

   document.querySelector(".bttn").addEventListener("click", (e) => {   
      e.preventDefault()
      document.querySelector('#outage').innerHTML = "";
      document.querySelector('#outage').innerHTML = `<object width=475 
      data="outage.txt"></object>`;
   });

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