单击iframe中的链接完全没有效果

And*_*een 3 html javascript

在谷歌浏览器中,我注意到点击某些链接似乎根本没有效果:

<a href="http://google.com">clicking this link does nothing at all.</a>
Run Code Online (Sandbox Code Playgroud)

这是一个JSBin和一个JSFiddle.

这是正常的,还是表明最新版Google Chrome存在某种错误?我之前从来没有遇到过这个问题,而这些类似的链接曾经对我很好.

Lee*_*lor 7

如果您查看开发人员控制台,您将看到以下内容:

Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

请参阅https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options

  • @AndersonGreen是的,当然.JSBin和JSFiddle都在iframe中运行代码.您遇到的是一种安全措施,可防止父网页干扰内容或窃取密码或用户信息. (2认同)