I don't why my website doesn't go through the if statement. The objective is to display an image when I click a button, but it gets stuck. If anyone could help I would be very happy :D
function showllum() {
$.get('llum.txt', function(data) {
alert(data);
if (data === "Llum") {
alert("1");
$('#showdada').empty();
$('#showdada').prepend($('<img>', {
id: 'llumpng',
src: 'llum.png'
}
))
} else if (data === "Molta Llum") {
alert("2");
$('#showdada').empty();
$('#showdada').prepend($('<img>', {
id: 'moltallumpng',
src: 'molta llum.png'
}
))
} else if (data === "Poca Llum") {
alert("3");
$('#showdada').empty();
$('#showdada').prepend($('<img>', {
id: 'pocallumpng',
src: 'poca llum.png'
}
))
} else if (data === "Fosques") {
alert("4");
$('#showdada').empty();
$('#showdada').prepend($('<img>', {
id: 'fosquespng',
src: 'fosques.png'
}
))
}})}