I am getting this error:

Refused to display ' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. 

I want to show instagram page inside my web because it is a mobile app and I want to use my back buttons.

This is my webpage:

<body> <div> <div> <a href="javascript:history.back()"></a> <h1>Instagram</h1> </div> <div> <iframe src="" name="IframeInstagram"></iframe> <script> var query = location.search.substring(1); //console.log(query); var parameters = {}; var keyValues = query.split(/&/); for (var i = 0; i < keyValues.length;i++) { var keyValuePairs = keyValues[i].split(/==/); var key = keyValuePairs[0]; var value = keyValuePairs[1]; parameters[key] = value; } /*+$(document).ready(function() { //console.log(parameters['page']); document.getElementById('iframeColaborador').src = parameters['colaborador']; }); */ //$(document).on("pageload", '#test', function() { $(document).on("pageshow", '#test', function() { //$(document).load(function() { console.log(parameters['instagram']); document.getElementById('iframeInstagram').src = parameters['instagram']; //document.getElementById('iframeNews').src = ' }); </script> </div> <!-- /content --> 

I was using this webpage to show others webs but I don't know why it fails with instagram.

1

3 Answers

YES, you can display instagram pages with this format

 

...inside iframes as long as you add the suffix /embed like

<iframe width="320" height="440" src="" frameborder="0"></iframe> 

See JSFIDDLE

7

You won't be able to because Instagram denies external websites from putting their website in a frame. This is why you got that error message about X-Frame-Options being set to SAMEORIGIN -- same origin means it will only allow Instagram to use the frame, but not others.

2

First of all Instagram let you embed the shares you did. All you have to do is

 1-open instagram from your web browser 2-click any share you have 3-at right bottom there is hidden menu with shape of ... (3 dot) click it 4-select second menu which is embed to website 5-click copy link from the next page and use that code to use instagram embeded link at your page 

also if you find it difficult or you want the pure code here is all you have to do use below code with your own url

<blockquote > <a href=""></a> </blockquote> <script async defer src="//"></script>