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.