Hi friends, I am using javascript sdk to post users' friends on the wall using jQuery facebook multi friend selector, but I am getting this error. friendId.split is not a function. Here is my code
function recommendToFriend(pic, url, friendId, fromName) { alert(friendId); var friendList ; pFriend = new Array(); pFriend = friendId.split(','); for( x in pFriend ) { alert(pFriend[x]); var publish = { method:'feed', picture:pic, link:url, name:'SHARP Product Recommend', caption: fromName + 'has recommend a product to you via Sharp Expert lounge', }; FB.api('/'+pFriend[x]+'/feed', 'post', publish, function(resp) { if( !response || response.error ) alert('Unable to share'); else alert('Successfully posted to firends wall'); }); } }
In the warning window, I received the divided identifiers of friends, so I use the column message of the function on each user wall separately, I do not know what is wrong here, please help me
source share