0

I have a simple ajax request to change the value of some php session variable I still get object object error no matter how I changed the code :

JS code:

$(document).ready(function(){
    $('#facebook_img').live('click',function(){
        login_condetion=1;
        $.ajax({
            type: "POST",
            url: 'facebook_login_condition_variable.php',
            data:{login_condetion:login_condetion},
            success: function()
            {
                alert('test');
            },
            error : function(XMLHttpRequest, textStatus, errorThrown) {
                alert(XMLHttpRequest);  
                alert(textStatus);
                alert(errorThrown);
                alert(XMLHttpRequest.responseText);
            }
        });

    });
});

facebook_login_condition_variable.php :

   <?php 
    $temp = $_POST['login_condetion'];
    if(!empty($temp) && $temp != 0)
    {
       $_SESSION['do_not_allow_auto_facebook_login'] = 1;
    }
    else    
    {
        $_SESSION['do_not_allow_auto_facebook_login'] = 0;  
    }
    ?>

I tried a lot of ajax form but same error and I get nothing when I alert responseText I do not understand why I still get that error ? I hope to find some help here thank u

2
  • 7
    login_condetion != login_condition Commented Jun 2, 2014 at 14:27
  • I fix this syntax error but nothing changed same error :( Commented Jun 2, 2014 at 14:34

1 Answer 1

2

This is not an error... It means that the variables you try to alert are objects.

If you want to see the content of it, replace alert by console.log and see the javascript console of your browser...

Sign up to request clarification or add additional context in comments.

3 Comments

i would recommend "console.dir()" for looking at objects
What I should pass to the console.log or console.dir my success function do not get any value or array or obj back ?
Because you will see the error message in your console... It's not you success function you need to log but XMLHttpRequest, textStatus and errorThrown as : console.dir(XMLHttpRequest); console.dir(textStatus); console.dir(errorThrown);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.