function(data, textStatus, jqXHR) {
$("#info").html(data);
if ((data).substr(0, 5)=="Please") {$("#imgOk").fadeIn();} // doesn't work
data is is php echo from another page. It is successfully placed into div #info and it’s content is:
Please, check your Inbox.
Assuming
datais fine,substr‘s second parameter is the amount of characters to retrieve, not the ending index. As “Please” is 6 letters, it should be.substr(0, 6).See http://www.w3schools.com/jsref/jsref_substr.asp for more info.