加载许多LinkedIN配置文件小部件的最快方法 [英] Fastest way to load many LinkedIN profile widgets
问题描述
对于成员概述,我使用了 LinkedIN成员配置文件来加载其所有LinkedIN配置文件插件.我已经加载了所需的javascript:
For a member overview I've resorted to loading all their LinkedIN profiles using the LinkedIN Member Profile Plugin. I've once loaded the required javascript:
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
之后,我循环浏览成员,并按一般方式加载其个人资料:
After which I'm looping through the members, generically loading their profiles:
<script type="IN/MemberProfile"
data-id="<?php echo $linkedin; ?>"
data-format="inline" data-related="false"></script>
$linkedin
是其个人资料的字符串.
Where $linkedin
is a string to their profile.
这有效,但是由于有大约40个成员,所以速度很慢.有没有一种方法可以缓存结果,或者使结果更快?
This works, but is tediously slow, due to there being around 40 members. Is there a way to cache the result, or make this work faster?
推荐答案
这有效,但是由于有大约40个成员,所以速度很慢.有没有一种方法可以缓存结果,或者使结果更快?
This works, but is tediously slow, due to there being around 40 members. Is there a way to cache the result, or make this work faster?
不,不是这样.这些插件会加载到iframe中,因此您无法通过JS访问内容.
No, not really. Those plugins load in an iframe, so you have no JS access to the content.
但是这些插件并不是真正要在单个页面上大量使用.如果您想更快",那么您将不得不通过他们的API并以这种方式获取会员详细信息/个人资料图片,以便您可以将它们存储到系统中,然后从那里进行服务.
But those plugins are not really meant to be used in multitudes on a single page either. If you want "faster", then you will have to go via their API and get the member details/profile pictures that way, so that you can store them into your system and then serve them from there.
这篇关于加载许多LinkedIN配置文件小部件的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!