I am making a ajax call and depending on the result I will swop my img, and fire an alert. Neither of which are happening, but I can't understand why this isn't happening??
var myd = "";
$.ajax({
url:"urlencode.php",
data: data,
type: "POST",
success: function(data) {
myd = $('<span />').html(data).find("#Result").text();
console.log(myd);
if (myd == 'c5:3;'){$(this).attr('src','lightbulboff.png')};
},
error: function (request, status, error)
{
alert(request.responseText);
}
});