Embedding instagram webpage inside an iframe

前端 未结 3 1650
旧时难觅i
旧时难觅i 2021-02-01 11:28

I am getting this error:

Refused to display \'http://instagram.com/p/page/\' in a frame because it set \'X-Frame-Options\' to \'SAMEORIGIN\'.

相关标签:
3条回答
  • 2021-02-01 11:51

    YES, you can display instagram pages with this format

    http://instagram.com/p/qbq6fIJMVZ
    

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

    <iframe width="320" height="440" src="http://instagram.com/p/qbq6fIJMVZ/embed" frameborder="0"></iframe>
    

    See JSFIDDLE

    0 讨论(0)
  • 2021-02-01 12:03

    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 class="instagram-media" data-instgrm-version="7" >
    <a href="https://www.instagram.com/p/BT8cmZRlkVJ/"></a> 
    </blockquote>
    <script async defer src="//platform.instagram.com/en_US/embeds.js"></script>
    
    0 讨论(0)
  • 2021-02-01 12:11

    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.

    0 讨论(0)
提交回复
热议问题