IFrame请求已取消 [英] IFrame request cancelled

查看:393
本文介绍了IFrame请求已取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个例子用于



要亲自看看,请尝试将源设置为 http://www.google.com/ ,但这并不会奏效,但请尝试 http://www.bbc.co.uk/ ,这将起作用。



可能的工作方式如下所述: https://stackoverflow.com/a/2896705/476786 使用 X-FRAME-OPTIONS


This example to load a url in an iframe works. However when I change url to something like http://www.yahoo.com the iframe doesn't load antyhing

Here is an example side by side.

In Network tab of developer tools for Chrome, I see that request to Yahoo was cancelled. In FF it doesn't give any errors, just doesn't return any content. IE9 gives a message that It cannot display this content.

This happens in Chrome, FF and IE9 (I haven't tested previous versions of IE).

解决方案

That is because Yahoo itself prevents this from happening.

It has been noted here: https://stackoverflow.com/a/9013722/476786

To see for yourself, try setting the source to http://www.google.com/ which won't work as well, but then try http://www.bbc.co.uk/ and that will work.

Possibly works as described here: https://stackoverflow.com/a/2896705/476786 using X-FRAME-OPTIONS

这篇关于IFrame请求已取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆