I have an issue when I want to change a background color of my div element via jquery after receiving an ajax respond, it doesn't work.(Code is validated, I tested it by entering a test line in error statement before changing css property and it worked.) Here is the code:
#statusbox {
background-color: #FFFFFF;
width: 15px;
height: 15px;
display:inline-block;
float: left;
position:relative;
left:190px;
top:3px;
border-style: solid;
border-width: 2px;
border-color: black;
}
And the jquery
success: function(msg) {
if (msg['connected']) {
$('#statusbox').css("background-color", "#00FF00");
} else $('#statusbox').css("background-color", "#FF0000");
},
error: function(error_msg) {
$('#statusbox').css("background-color", "#00FF00");
}
#{after else. Please validate your code first before asking questions — sometimes it all boils down to a typo.