0
我想要從名爲getProfileData
的函數獲取名爲data
的LinkedIn API返回的數據。我如何訪問包含firstName
和lastName
之類信息的數據,而不是在getProfileData
中,而不僅僅是功能onSuccess
?從LinkedIn SDK獲取LinkedIn返回的數據
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: YOUR_API_KEY_HERE
authorize: true
onLoad: onLinkedInLoad
</script>
<script type="text/javascript">
// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {
IN.Event.on(IN, "auth", getProfileData);
}
// Handle the successful return from the API call
function onSuccess(data) {
console.log(data);
}
// Handle an error response from the API call
function onError(error) {
console.log(error);
}
// Use the API call wrapper to request the member's basic profile data
function getProfileData() {
IN.API.Raw("/people/~").result(onSuccess).error(onError);
// I want to see the profile data in here.
}
</script>
data.firstName,data.lastName中的onSuccess功能 – Sankar