简体   繁体   English

当在DIV中将我的LinkedIn公开资料页面作为HTML包含在DIV中时,它会接管我自己的jQuery,包括如何停止此操作?

[英]When including my LinkedIn public profile page as HTML inside a DIV it takes over my own jQuery includes how can i stop this?

I can't be doing with the whole member profile auth thingy from LinkedIn, I just want to put our public profiles onto our site within our profile sections: 我无法处理来自LinkedIn的整个会员个人资料auth的事情,我只想在我们的个人资料部分中将我们的公开个人资料放到我们的网站上:

I can use a php include to do this and all is well, except that it ruins my jQuery already on my page and thus the tabs and their contents don't work. 我可以使用php include做到这一点,一切都很好,除了它破坏了我已经在页面上的jQuery,因此选项卡及其内容不起作用。

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
}

how can I isolate the LinkedIn HTML refs to only affect this DIV called profiles that it is within and thus still get my tabs to work properly? 如何隔离LinkedIn HTML引用仅影响该DIV,即它所在的配置文件 ,从而仍然使我的标签正常工作?

currently it affects global CSS as well. 当前它也影响全球CSS。

here is the iframe code that doesn't work at all just a blank box: 这是完全无效的iframe代码,只是一个空白框:

            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>

EDIT 3 编辑3

So here's the api page copied directly from linkedin site with my api key number in it and this gives me this error: 所以这是直接从linkedin站点复制的api页面,其中包含我的api密钥号,这给了我这个错误:

'); IN.parse(document.getElementById("profile")) }) }

which seems to me to be the ' is opening or closing something that it then can't read after it... in dreamweaver there is no syntax errors or anything on that line but line 6, where the key is has got one that makes no sense... the number 5 at the start is red and yet if i build this from the bottom up i can get hello Robbie Miller to appear but as soon as i build the profile div it asks for in the JS it does this` 在我看来,这是'正在打开或关闭它随后无法读取的内容...在Dreamweaver中,该行上没有语法错误或任何内容,但第6行的关键是有一个没道理...开头的数字5是红色的,但是如果我从头开始构建它,我会打招呼罗比·米勒出现,但是一旦我构建了div档案,它就会在JS中要求这样做。

<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>`

You could just put it in an iFrame like Diodeus said or you can follow Linkedin's own help 您可以像Diodeus所说的那样将其放在iFrame中,也可以按照Linkedin的帮助进行操作

http://help.linkedin.com/app/answers/detail/a_id/85 http://help.linkedin.com/app/answers/detail/a_id/85

It describes ways to help promote your profile. 它描述了帮助提升个人资料的方法。 Most people just have a follow link on their site to their profile or their companies page. 大多数人在他们的网站上都只有一个跟随链接,可以看到他们的个人资料或公司页面。

UPDATE: Looks like the frame is causing a cross origin problem. 更新:看起来框架正在引起跨原点问题。

so the only real solution is to use Linkedin tools 所以唯一真正的解决方案是使用Linkedin工具

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用LinkedIn API获取我自己的完整档案 - Get my own full profile with LinkedIn API 如何将WordPress中the_posts_pagination的页码包装到我自己的div中? - How can I wrap page numbers from the_posts_pagination in WordPress into my own div? 如何为“解析” HTML链接创建自己的正则表达式? - How can I create my own regex for “parse” HTML links? 如何在Wordpress中重定向到我自己的页面? - How can i redirect to my own page in wordpress? 我想刷新我的 html 页面上可用的所有 div,即按标签,我有 2 个代码如何 imerge - i want to refresh my all div available on my html page i.e by tag and i have 2 codes how can imerge 阻止jQuery将整个页面返回到我的div中 - Stop jQuery from returning entire page into my div 如何在html页面中显示数据库的值? - How can i show the values of my database in my html page? 当我使用jQuery AJAX在页面上提交tinyMCE表单时,需要两次单击才能实际提交到数据库 - When I use jQuery AJAX to submit tinyMCE forms on my page, it takes two clicks to actually submit to database 如何使用 jquery 加载整个 html 页面,包括新的 jquery 功能? - How can I load an entire html page with jquery including new jquery functions? 在我的HTML / PHP页面上选择下拉项时,如何在jQuery(AJAX)中检测到? - How do I detect in jQuery (AJAX) when a drop down item is selected on my HTML/PHP page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM