首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当将我的LinkedIn公共配置文件页面作为HTML包含在DIV中时,它会接管我自己的jQuery,包括如何阻止这种情况?

当将我的LinkedIn公共配置文件页面作为HTML包含在DIV中时,它会接管我自己的jQuery,包括如何阻止这种情况?
EN

Stack Overflow用户
提问于 2013-08-12 17:00:00
回答 1查看 2.4K关注 0票数 0

我不能使用LinkedIn的所有成员配置文件,我只想将我们的公共配置文件放到我们的配置文件部分中:

我可以使用php来完成这个任务,这一切都很好,只不过它破坏了我的页面上的jQuery,因此选项卡和它们的内容无法工作。

代码语言:javascript
复制
function getProfileDivs ($dbc, $pg) {


    $q6 = "SELECT * FROM profilelinks WHERE parent='$_GET[title]' AND status=1 ORDER BY id ASC ";
    $r6 = mysqli_query($dbc, $q6);

    if ($r6) {

while ($link2 = mysqli_fetch_assoc($r6)) {

        $thread=$link2['label']; 

    echo "<div id='".$thread."'>";

        if ($thread=='Profile') { 
        $profile= $_GET['title'];
            profilePost ($dbc, $pg); 
        echo    '<div id="linkedin">';
        include ('http://www.linkedin.com/in/abstrkt'.$profile.'');
        echo    '</div>';

        }elseif ($thread=='Mixcloud'){ 

            echo '<h2>'.$thread.'</h2>'; 
            personalBlogs ($dbc, $pg, $thread); 
            echo "<script src='http://widget.mixcloud.com/media/js/follow_embed.js'></script>"; 

        }else{ 

                echo '<h2>'.$thread.'</h2>'; 
                personalBlogs ($dbc, $pg, $thread); 

            }
    echo '</div>';      }//create Divs dynamicallly CLOSE
        }//get Div Id's from table and display CLOSE
}

我如何隔离LinkedIn HTML,使其只影响它所在的这个称为DIV的配置文件,从而仍然使我的选项卡正常工作?

目前,它也影响到全球CSS。

下面是完全不起作用的iframe代码,它只是一个空白框:

代码语言:javascript
复制
            if ($thread=='Profile') { 
            $profile= $_GET['title'];
                profilePost ($dbc, $pg); 
            echo    '<div id="linkedin">';
            echo '<iframe src="http://www.linkedin.com/in/abstrkt'.$profile.'" width="100%" height="450px" scrolling="yes"></iframe>';
            //include ('http://www.linkedin.com/in/abstrkt'.$profile.'');
            echo    '</div>';

here is what the iframes look like on view source of the page for the whole tabs structure, everything works like this except the 1st linkedin iframe:

    <div id="MainContent" class="background1"> <div id="ProfileStructure" class="ProfileStructure"><ul><li><a href=#Profile>Profile</a></li><li><a href=#Soundcloud>Soundcloud</a></li><li><a href=#Mixcloud>Mixcloud</a></li><li><a href=#Vimeo>Vimeo</a></li><li><a href=#Programming>Programming</a></li></ul><div id='Profile'><div id="linkedin"><iframe src="http://www.linkedin.com/in/abstrktRobbie" width="100%" height="450px" scrolling="yes"></iframe></div></div><div id='Soundcloud'><h2>Soundcloud</h2><div id="blogPosts">
        <table>
        <tr><h3>Soundcloud by Robbie</h3></tr>
        <tr><iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F4985712&amp;color=8267c9&amp;auto_play=false&amp;show_artwork=true"></iframe></tr>
        </table> <br></br></div></div><div id='Mixcloud'><h2>Mixcloud</h2><div id="blogPosts">
        <table>
        <tr><h3>Mixcloud by Robbie</h3></tr>
        <tr><div><object width="100%" height="480"><param name="movie" value="//www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http%3A%2F%2Fwww.mixcloud.com%2FEnnoia_Delusions_of_Self%2F%3Flimit%3D10&embed_uuid=90a1ce18-e71a-45f4-825f-c2097e674728&stylecolor=&embed_type=widget_standard"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="opaque"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http%3A%2F%2Fwww.mixcloud.com%2FEnnoia_Delusions_of_Self%2F%3Flimit%3D10&embed_uuid=90a1ce18-e71a-45f4-825f-c2097e674728&stylecolor=&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="100%" height="480"></embed></object><div style="clear:both; height:3px;"></div><p style="display:block; font-size:12px; font-family:Helvetica, Arial, sans-serif; margin:0; padding: 3px 4px; color:#02a0c7; width:auto;"><a href="http://www.mixcloud.com/Ennoia_Delusions_of_Self/?utm_source=widget&amp;utm_medium=web&amp;utm_campaign=base_links&amp;utm_term=resource_link" target="_blank" style="color:#02a0c7; font-weight:bold;">Latest Ennoia's Cloudcasts</a><span> on </span><a href="http://www.mixcloud.com/?utm_source=widget&utm_medium=web&utm_campaign=base_links&utm_term=homepage_link" target="_blank" style="color:#02a0c7; font-weight:bold;"> Mixcloud</a></p><div style="clear:both; height:3px;"></div></div>

<div style="clear:both; height:3px; width:auto;"></div><p style="display:block; font-size:12px; font-family:Helvetica, Arial, sans-serif; margin:0; padding: 3px 4px; color:#f3eaf5; width:auto;"><a href="http://www.mixcloud.com/Ennoia_Delusions_of_Self/?utm_source=widget&amp;utm_medium=web&amp;utm_campaign=base_links&amp;utm_term=resource_link" target="_blank" style="color:#f3eaf5; font-weight:bold;">Latest Ennoia's Cloudcasts</a><span> on </span><a href="http://www.mixcloud.com/?utm_source=widget&utm_medium=web&utm_campaign=base_links&utm_term=homepage_link" target="_blank" style="color:#f3eaf5; font-weight:bold;"> Mixcloud</a></p><div style="clear:both; height:3px;"></div>
<a class="mixcloud-follow-widget" href="http://www.mixcloud.com/Ennoia_Delusions_of_Self/" data-h="160" data-w="315" data-faces="on">Follow Ennoia on Mixcloud</a></tr>
        </table> <br></br></div><script src='http://widget.mixcloud.com/media/js/follow_embed.js'></script></div><div id='Vimeo'><h2>Vimeo</h2><div id="blogPosts">
        <table>
        <tr><h3>Vimeo by Robbie</h3></tr>
        <tr><iframe src="http://player.vimeo.com/hubnut/user/user2484971/uploaded_videos?color=000000&amp;background=ffffff&amp;slideshow=0&amp;video_title=1&amp;video_byline=1" height="450" width="100%"></iframe></tr>
        </table> <br></br></div></div><div id='Programming'><h2>Programming</h2><div id="blogPosts">
        <table>

        </table> <br></br></div><div id="blogPosts">
        .<br></tr>
        </table> <br></br></div></div></div>    </div>

编辑3

下面是直接从linkedin站点复制的api页面,其中包含我的api密钥号,这给了我这个错误:

代码语言:javascript
复制
'); IN.parse(document.getElementById("profile")) }) }

在我看来,这是“打开或关闭的东西,然后它看不出来.在dreamweaver中,该行上没有语法错误或任何东西,但是第6行,其中键有一个没有意义的.开头的数字5是红色的,但是如果我自下而上构建这个,我可以让你罗比·米勒出现,但是一旦我在JS中构建了它所要求的配置文件div,它就这样做了。

代码语言:javascript
复制
<html>
<head>
<title>Profile App Example</title>

<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: 5m5y1ybx85gp
  authorize: true
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5b1.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>  

<script type="text/javascript">

function loadData() {
IN.API.Profile("me")
   .result(function(result) { 
      $("#profile").html('<script type="IN/FullMemberProfile" data-id="' + result.values[0].id + '"></script>');
      IN.parse(document.getElementById("profile"))
   })
}

</script>

</head>
<body class="yui3-skin-sam     yui-skin-sam">
<div id="profile"></div>
<script type="IN/Login" data-onAuth="loadData"></script>
</body>
</html>`
EN

回答 1

Stack Overflow用户

发布于 2013-08-12 18:45:29

你可以像Diodeus说的那样把它放到iFrame中,或者你可以跟随Linkedin自己的帮助

id/85

它描述了帮助提升你的个人资料的方法。大多数人只是在他们的网站上有一个链接到他们的个人资料或他们的公司页面。

更新:看起来像是框架造成了跨源问题。

所以唯一真正的解决办法就是使用Linkedin工具

  • http://breezi.com/how/show-your-linkedin-profile-on-your-site/
  • http://developer.linkedin.com/plugins
  • http://developer.linkedin.com/forum/using-linkedin-profile-data-own-website
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18192611

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档