-2
I’m trying to fill a table using javascript with the data coming from an ajax model. of that fortress :
$("#md").on("click", function() {
if (FA.checked) {
$("div.hidden").css('display', 'block');
$.ajax({
url: "/treino",
method: "GET",
contentType: 'application/json; charset=utf-8',
success: function(resp) {
$('#score1').append(resp.scoreF);
}
})
}
})
The code is working! when I press the button my table in html adds the expected value in the waiting location with the append function , the problem is that when I press the button again the table adds the value again , getting two values one next to the other , i would like a function that simply replaces one value with another !
Tricky to help you because the error is local, you need to show us with a minimal example, only this code does not help us to help you!
– novic
Thank you for answering, I will try to reformulate the question being clearer and objective !
– Marcelo Ivan