1
$.ajax({
url: 'executa.php',
type: 'POST',
data: {emailDestino: emailDestino},
dataType: 'html',
success: function(data) {
$('#notifyInscrito').appendTo(data);
}
});
I’m going to the file room executa.php
via ajax with an email, and making a query to assemble an HTML with the returned data, and I want to put this complete HTML inside the div
#notifyInscrito
. Which is a lightbox that soon after will send an email to the record of the returned data.
I tried to make a $('#notifyInscrito').appendTo(data)
in order for it to return the form from within the executa.php
and insert into the div
but it didn’t work.
Question: How to get HTML from executa.php
and place inside the div
#notifyInscrito
?
Place the file information
executa.php
– Edilson
The
dataType
hasDefault = String
, remove thedataType
to treat it as plain text, or change totext
.– Guilherme Lautert
use the function
.html()
instead of.appendTo()
– Pedro Sanção