خرید بک لینک

Vote count: 0

I'm trying to get the ID of a signed in user in Google Chrome using a separate function, however the gaiaId variable always seems to be 'undefined' even though userId contains the ID (I checked).

How do I retu the id from the function that's called?

function getGaia(){
   chrome.identity.getProfileUserInfo(function(userInfo) {
      var userId = userInfo.id;
      alert(userId);
      retu userId;
   });
}

var gaiaId = getGaia();
alert(gaiaId);

asked 21 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 12 مرداد 1395 ساعت: 8:22

صفحه بندی