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

125
Vistas
XMLhttprequest in chrome sending twice with the tampermonkey extension

I've been using tampermonkey for awhile to send some data over to my mysql database, but today I noticed that it actually sends the data to add twice, I'm thinking it's because some chrome update cause it seems to work fine in my laptop which has an older version of the browser.

Heres the code:

function Save_task_time(){
   var estimado=document.getElementsByClassName("thing");
   var est = estimado[0].innerHTML.split(" ");
   var time=document.getElementsByClassName("the thing");
   
   var xhr = new XMLHttpRequest();
   
   xhr.open('GET', "http://localhost/taskTime.php?estimate="+est[0]+"&taskTime="+time[0].innerHTML, true);
   xhr.send();
}
window.onsubmit = Save_task_time;

I know it's probably not the most efficient,proper or best way to do this but it did the trick for me, i've also checked and tested taskTime.php to see the problem was not there.

Kinda just looking for a way to ensure the sending doesn't duplicate.

Thanks to everyone who takes the time to respond.

about 4 years ago · Juan Pablo Isaza
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