iframe“(站点名称)拒绝连接."错误 [英] Iframe "(Site Name) Refused to Connect." Error

查看:193
本文介绍了iframe“(站点名称)拒绝连接."错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CN:我在项目中使用的 iframe 元素的内容是(站点名称)拒绝连接".我收到错误,我该如何解决这个错误?

EN : The content of the iframe element I use in my project is "(site name) refused to connect." I get the error how can I fix this error?

TR : Projemde kullandığım iframe öğesinin içeriği(site adı) bağlanmayı reddetti".Hatası alıyorum, bu hatayı nasıl düzeltebilirim?

TR : Projemde kullandığım iframe öğesinin içeriği "(site adı) bağlanmayı reddetti." Hatası alıyorum, bu hatayı nasıl düzeltebilirim?

<iframe src="https://www.google.com/" frameborder="0"></iframe>

https://jsfiddle.net/fatihege/2he1nuyf/

推荐答案

这不是您的代码,因为网站可以阻止自己被框架.你对此无能为力.

It's not your code as sites can block themselves from being framed. Nothing you can do about it.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
</head>
<body>
  <iframe src="https://www.google.com/" frameborder="0"></iframe>
</body>
</html>

但是使用另一个域(example.com):

But with another domain (example.com):

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
</head>
<body>
  <iframe src="https://www.example.com/" frameborder="0"></iframe>
</body>
</html>

您还可以使用 Google CSE(自定义搜索引擎)来解决,它可以轻松插入到 iframe 中.您可以创建自己的搜索引擎,搜索选定的网站或整个 Google 数据库.

You can also solve using Google CSE (Custom Search Engine), which can be easily inserted into an iframe. You can create your own search engine, that search selected sites or also in entire Google's database.

事实证明,谷歌已经让他们的网站现在可以被 iframe,但对于其他一些域,它不起作用.

It turns out google has made their site possible to be iframed now, but with some other domains it will not work.

这篇关于iframe“(站点名称)拒绝连接."错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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