1
Hello, I am creating an ajax but if I use find to return in the desired div it does not return
success: function (ret) {
if (ret == "sucesso") {
$(this).find(".msg-envio").html("<p class='msg-sucesso'>Orçamento enviado com sucesso!</p>");
}
else {
$(this).find(".msg-envio").html("<p class='msg-erro'>Houve um erro ao enviar o orçamento.</p>");
}
}
It worked Sergio, I didn’t know this was neutral inside the ajax, Obg.
– Lourençon O.
@Brendoll. great that worked. I joined another alternative now to complete.
– Sergio
Just to let you know. Reduce the search scope of
find()
, it is costly, for it sweeps through all GIFT in search of pouch. If you know where your.msg_envio
, restrict the search. Ex:$('#divQueContemMsgEnvio').find('.msg_envio')
will already reduce the scope of the search. Or change afind()
by an id$('#id_msg_envio')
is very performatic.– Thiago Lunardi
@Thiagolunardi well seen. By the way (Brendol L.) this element
$(self).find(".msg-envio")
should be cached, so you don’t have to call the selector every time.– Sergio