这样,您便可以使用一些jQuery和LinkedIn API 将LinkedIn连接快速加载到漂亮的缩略图链接中。 查看下面的演示。 注意:您还需要包括来自LinkedIn的API密钥,您可以从LinkedIn开发者网络获取该密钥。
演示版
使用LinkedIn登录以加载您的连接。
领英联系
![装货 loading](https://www.sitepoint.com/images/ajax-loader.gif)
jQuery的
function loadLinkedInData() { //element cache var connectionsElem = jQuery("#connections"), loadingElem = connectionsElem.find('.loading'); //show loading image loadingElem.show(); //load in linkedin connections IN.API.Connections("me") .fields(["pictureUrl","publicProfileUrl"]) //fields to load in .params({"count":30}) //number of thumbs to display .result(function(result) { //process the results for each connection create html var profHTML = "
"; jQuery.each(result.values, function(i,v) { if (v.pictureUrl) { profHTML += " "; profHTML += "
'; //display the connections html jQuery("#connections").html(profHTML); }); }"; } }); profHTML += '
的HTML
LinkedIn Connections
![]()
From: https://www.sitepoint.com/display-linkedin-connections/