Why Iframe dosen't work for yahoo.com

后端 未结 4 1909
感情败类
感情败类 2020-12-12 00:46

I find this doesn\'t work:


I have read this question, but I don\'t understand w

4条回答
  •  一个人的身影
    2020-12-12 00:59

    You're having issues with Cross-origin resource sharing. Read these Wikipedia CORS and MDN CORS articles.

    As for your snippet,

    
    

    needs to be added to the page being served and not to the page/code requesting it, which in this case would be yahoo.com. But as you don't serve yahoo.com yourself, there is no way of adding it.

    However if the question was regarding your own pages and yahoo.com was just an example, you can simply set correct HTTP headers as specified in the articles, and you'd be good.

提交回复
热议问题