0

I am not able to open google's home page through iframe and also facebook's login page trough iframe. I saw Mozilla's X-frame page but couldn't make out a lot. Can someone tell me why is this happening and if possible the code for iframe to open googles home page instead of showing an empty white iframe?

The code:

$(document).ready(function() {

$('.iframe').fancybox({
        width : '90%',
        height : '90%',
        titlePosition: 'outside'
    });
}); // end ready

<div class="content">
    <div class="main">
        <h3>For more such beautiful photos visit XYZ on:</h3><br/>
        <ul>
            <li>
                <a href="complete_menu.html" class="iframe" title="Website">His own Web site</a>
            </li>
            <li>
                <a href="http://www.facebook.com/XYZ" class="iframe" title="Facebook">Facebook</a>
            </li>
            <li>
                <a href="http://www.gmail.com/" class="iframe" title="Gmail">Gmail</a>
            </li>
        </ul>
    </div>
</div>
AntouanK
  • 4,880
  • 1
  • 21
  • 26
Siddarth
  • 21
  • 5

1 Answers1

1

The reason for this is, that Google is sending an "X-Frame-Options: SAMEORIGIN" response header.

this question was asked before How to show google.com in an iframe?

Community
  • 1
  • 1
LorDex
  • 2,591
  • 1
  • 20
  • 32
  • Can you send what to do for that. I am not getting it. It is quite simple everyone are telling me but I still cant figure it out – Siddarth Nov 13 '12 at 10:07
  • the answer is - you can't do anything about it. Google prevents his page from being displayed on iframe. Why do you need it for? If you want to embed google search engine on your website, google provides that kind of services. – LorDex Nov 13 '12 at 10:11
  • looks like it's a cross-domain issue – Raptor Nov 13 '12 at 10:32
  • cross-domain issue occurs when you try to manipulate page inside iframe from outside of this iframe. Mere displaying website does not qualify for cross-domain restrictions. – LorDex Nov 13 '12 at 10:39