I have this simple attacched code, I can get right text on the first debug alert but the search and if condition doesn't work, what is wrong in my code? Or there is a better way to do the same?
thanks in advance
ciao h
$.post("./php/piattaforma.php",
{azione:"valida_pia", contratto:contratto},
function(xml)
{
$(xml).find("sel_mess").each(function()
{
var messaggio=$(this).text();
alert(messaggio);
var str=messaggio.search("text");
if (str!=-1)
{
alert("ok");
}
});
},"xml"
);