Very simply put, in the ajaxSuccess part, of my GET method, for retrieving data, I have 12 if
s like so(part of the code):
success: function (result) {
if ((result.AppTime = "9:00") && (result.AppWithYritys = "Laakkonen")) {
document.getElementById("A9").style.background = "red";
}
if ((result.AppTime = "9:30") && (result.AppWithYritys = "Laakkonen")) {
document.getElementById("A930").style.background = "red";
}
if ((result.AppTime = "10:00") && (result.AppWithYritys = "Laakkonen")) {
document.getElementById("A930").style.background = "red";
}
if ((result.AppTime = "10:30") && (result.AppWithYritys = "Laakkonen")) {
document.getElementById("A930").style.background = "red";
}
if ((result.AppTime = "11:00") && (result.AppWithYritys = "Laakkonen")) {
document.getElementById("A930").style.background = "red";
}
depending on the data retrieved from the database, it should color the appropriate div
, as You can see, but it is coloring all of the div
s and I know that the only thing that exists in the database and can be retrieved is the first if, only the first if is true. Am I doing something wrong?
Aucun commentaire:
Enregistrer un commentaire