Tom Powers
asked on
Records adding to table becoming duplicates
I have a table and it gets populated with data of NBA Players stats I use a timer to update the stats however what happens is when It updates it appends same information to information already there so I have two sets until the timer goes off giving me three I tried using this
function clearData() {
document.getElementById("p layLog").i nnerHTML = '';
}
But this wipes everything so I tried this with the timer However still the table disappeared for good. any suggestions
var myVar=setInterval(function (){myTimer ()},8000);
function myTimer()
{
loadData();
clearData();
loadData();
}
</script> I can attach html and xml file the xml file will be static so you won't know if values are getting updated but I guess you can clear table then have table come back that would be a sign of progress. Maybe if the Images were loaded during $(document).ready(function () { Then a similar function was called during the timer update that only updated the statistic numbers that might be even better on browser or Mobile Browser. Thanks EE
Table1.html
18753.XML
function clearData() {
document.getElementById("p
}
But this wipes everything so I tried this with the timer However still the table disappeared for good. any suggestions
var myVar=setInterval(function
function myTimer()
{
loadData();
clearData();
loadData();
}
</script> I can attach html and xml file the xml file will be static so you won't know if values are getting updated but I guess you can clear table then have table come back that would be a sign of progress. Maybe if the Images were loaded during $(document).ready(function
Table1.html
18753.XML
ASKER
That was one of the combinations I already tried. Try it with the attachments. Thanks awayway
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
All a bit long winded really. Add this at the start of the ajax done() function
$('#players tbody tr').not('#rowTemplate').remove();
And add this at the end:setTimeout(loadData,8000);
Remove the setTimer script and you're good to go.
ASKER
Robby back! Very helpful and Project is coming along Thanks to Robby Chris and other EE Guys This site I know I abuse it Is a lifesaver. These experts are insanely smart and it great to learn off them and I don't always get the 1st time or even the second but this site stores everything for reference and I'm really happy with the site and Experts I met.
{
clearData();
loadData();
}
</scrip