开发者

FB.api('/me/likes/124745260879931', onMyLikesResponse); not working on IE 9

开发者 https://www.devze.com 2023-04-11 06:23 出处:网络
any reason why the below code would not work in IE9 yet work in every other browser i try?: FB.init({appId: \'######\', status: true, cookie: true, xfbml: true});

any reason why the below code would not work in IE9 yet work in every other browser i try?:

FB.init({appId: '######', status: true, cookie: true, xfbml: true});

FB.api('/me/likes/######', onMyLikesResponse);

function onMyLikesResponse(response)
{
    console.log("length" + response.data.length);
    co开发者_StackOverflownsole.log(response);
    if(response.data.length==1){
        $('#like').show();
    }   
}


FB.login(function(response) {
                if (response.status == 'connected') {
                    var page_id = "40796308305";  

                    FB.api('/me/likes/'+page_id, function(response) {
                        if (response.data[0]) {
                            $('#like').show();
                        }
                    });
                } else {
                    // user is not logged in                        
                }
            });

I think length will not work on json response. Make sure developer tools are open in IE9, cause you are using console.log.

0

精彩评论

暂无评论...
验证码 换一张
取 消