Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

php - Displaying Facebook in an Iframe on my website

I want to Display Facebook's Webpage on my site ?

<html>
<body>
    <iframe src="http://www.facebook.com/" name="iframe_a"></iframe>
</body>
</html>

This just show's me an image of Facebook but not the actual content. How can i do that ?

I tried and used Php and then echoed the content on the screen that some how worked But In that case , I cant understand How shall i Login Into facebook. When i Login it get's redirected to the Main Site.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is the code facebook embedded in its pages.

if (top != self) { try { if (parent != top) { throw 1; }

This code checks if its embedded in iframe its blocks loading other data rather loads the the link to which you can click with an image.

<script type="text/javascript">
        /* <![CDATA[ */if (top != self) { 
           try { if (parent != top) { throw 1; } 
           var disallowed = ["apps.facebook.com","/pages/","apps.beta.facebook.com"];
            href = top.location.href.toLowerCase(); 
              for (var i = 0; i < disallowed.length; i++) {
                  if (href.indexOf(disallowed[i]) >= 0) { throw 1; } 
              } 
          } catch (e) {
             setTimeout(
                   function() {var fb_cj_img = new Image(); 
                      fb_cj_img.src = "http://error.facebook.com/common/scribe_endpoint.php?c=si_clickjacking&m=onu002509&t=8183";}, 5000); 
        window.document.write("u003cstyle>body * { display:none !important; }u003c/style>u003ca href="#" onclick="top.location.href=window.location.href" style="display: block !important; padding: 10px">u003ci class="img sp_8dfqpl sx_d67a9a" style="display:block !important">u003c/i>Go to Facebook.comu003c/a>");

  /* XRCm4Hhw */ }}/* ]]> *

  </script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...