简体   繁体   中英

Issue in Displaying facebook friends profile picture

I'm integrating facebook in my phonegap app, where facebook friends profile picture, names and birthday dates are displayed, now able to display name and birthday dates but not profile picture. i'm getting blue rectangular box question mark image in place of profile picture instead of profile picture. Please help me.

 function me() {
            FB.api('/me/friends', {fields: 'id, name, picture,birthday' },  function(response) {
                   if (response.error) {
                   alert(JSON.stringify(response.error));
                   } else {
                   var data = document.getElementById('data');
                   fdata=response.data;
                   console.log("fdata: "+fdata);
                   response.data.forEach(function(item) {
                                         var d = document.createElement('div');
                                         d.innerHTML = "<img src="+item.picture+item.birthday+"/>"+item.name+"<br>"+item.birthday;
                                         data.appendChild(d);
       }
  }

替换内部HTML行代码,如下所示:

d.innerHTML = "<img src=" + item.picture + "/>" + item.name + item.birthday;

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