简体   繁体   中英

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

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);
    console.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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM