JQuery / Ajax success not render html function
I have a DIV like this <div id="message"></div>
and am trying to add content to this DIV with success Ajax
.
This is how my ajax code looks like:
var data = $("form#password_forgotten").serialize();
$.ajax({
type: "POST",
url: "./includes/process_password.php",
data: data,
cache: false,
success: function (response) {
console.log(response);
$('#message').html(response);
}
});
But I cannot fill the #message
div with this ajax response. But this ajax encoding works for me and this is what I can get for the console.
<div class='alert alert-danger alert-dismissible' role='alert'>
<strong>Oops!</strong> Email address not recognised. Please try another.
</div>
Can anyone tell me what happened to this?
Thank.
+3
source to share
1 answer