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

190
Views
Actualizador de archivos ajax para verificar la hora de la última modificación de un archivo y luego actualizar

Tengo un código que me gustaría actualizar (refrescar) si mi archivo ha sido modificado desde entonces y está en un bucle, por lo que seguiría intentando impulsarlo, ¿alguien puede ayudarme a hacerlo funcionar? aquí está el código;

 <script> var checkUrl="messages.php"; window.setInterval("checkForUpdate()", 1000); var pageLoad = new Date().getTime(); function checkForUpdate() { $.ajax(checkUrl, { type : 'HEAD', success : function (response, status, xhr) { if(firstCheck === false) { firstCheck = true; return; } var lastModified = new Date(xhr.getResponseHeader('Last-Modified')) .getTime(); if(lastModified > pageLoad) { window.location.replace("./"); } } }); } </script>
about 4 years ago · Juan Pablo Isaza
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!