and am trying to add content to this DIV wi...">

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


According to the conversation in the comments

Now I found that my #message DIV is getting filled, but it is hiding from my page. How is it - Oh! The email address was not recognized. Please try another one.



Summarizing the answer as

After filling in HTML add $('#message').show()

0


source







All Articles