weixin_33714884 2014-06-02 14:26 采纳率: 0%
浏览 34

为什么我得到对象对象错误?

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

  • 写回答

1条回答 默认 最新

  • hurriedly% 2014-06-02 14:28
    关注

    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...

    评论

报告相同问题?