php - Can't call ajax POST request inside FB.api -
for facebook login i'm using code
fb.api('/me', {fields: 'birthday,cover,devices,email,first_name,gender,id,last_name,link,location,name,name_format,timezone,verified,website,locale'}, function(response) { $.ajax({ url: '/login/facebook', type: 'post', data: { fb: response, window: window.ui}, datatype: 'json', success: function (data) { console.log(data); }, error: function (xhr, ajaxoptions, thrownerror){ notice(xhr); notice(ajaxoptions); } }); });
if i'm calling without {fields: '...'} working when added fields ajax sending request server instead of post, how response desired fields fb.api , post server?
i fixed problem little change in code instead of url: '/login/facebook',
wrote url: '/login/facebook/',
/ @ end , problem solved !
Comments
Post a Comment