0

I am trying to embed one of my website into a html page, but I am unable to do that. I have tried to embed my other two websites and those are displaying correctly and the remaining one not displayed in my page.

After I have tried to access https://www.google.com and its also not displayed in my html page.

I have used the code:

Can we access the websites like google, facebook etc with object or iframe tags.

I have tried with both iframe and object tags but I was failed to access the website.

Please tell me is there any methods to access the websites like google or facebook etc.

Thanks in advance......

1 Answers1

0

For security purpose you can't embed the websites with ssl prefix i.e. https. Although you can embed the website that uses http protocol like the code mentioned below:

<iframe src="http://www.techgig.com" height="600" width="700" frameborder="0"></iframe>

This might work if there is no protection applied for X-Frame-Options i.e. webistes with http prefix can also deny loading it in to iframe via X-Frame-Options in their .htaccess file. For e.g. stackoverflow has applied .htaccess security so you'll see this error in mozilla console when try to load it within iframe:

Load denied by X-Frame-Options: https://stackoverflow.com/ does not permit cross-origin framing.

However for websites with https prefix doesn't allow to be loaded in to iframe since they have aleady applied security for iframe injection in their website. Hence the wbsites like https://www.google.com & https://www.facebook.com will not load in your iframe.

Community
  • 1
  • 1
k10gaurav
  • 462
  • 7
  • 24