Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!