vendredi 11 septembre 2020

response from server json doesn't make my condition true

Why is this my response from the server doesn't make my condition true in returning success.

Here is my simple code:

Here i have a server side which is returning this code after a request from client:

$response['success']='true';
header('Content-Type', 'application/json');
echo json_encode($response);

In my script, I have something like this which I have a problem and it's not making my if condition into true

if(response.success === 'true') {
    $('.spnner_here').html('');                                     
    $(":submit").attr("disabled", false);
    swal('Successfully save', {
        icon: "success",
    });                     
    window.location = baseurl+'user_child_info';
}else {

}

Aucun commentaire:

Enregistrer un commentaire