【发布时间】:2017-11-03 05:24:52
【问题描述】:
如何通过 iframe 阻止我的网站?例如,YouTube 不能出现在 iframe 中,它会说该网站的所有者已经阻止了 iframe。我知道这样的元标记方式
<meta http-equiv="X-Frame-Options" content="deny">
howerver 对我不起作用,有没有其他方法,我更喜欢使用 javascript 和 html 没有 apachi php ajax 或其他请。这是我希望在我的网站上阻止的 youtube iframe。也没有.htaccess
<!DOCTYPE html>
<html>
<head>
<title>YouTube</title>
</head>
<body>
<iframe width="50%" height="50%" src="http://www.youtube.com" >
</iframe>
</body>
【问题讨论】:
-
它不是重复的,我也不想要 .htaccess 方式。
-
This answer from that question 包括一个javascript解决方案!
-
@Hodrobond 这个问题的答案没有用,我的答案确实有效
-
@MohammadHamedani 这个问题的答案没有用,我的答案确实有效,而且......它不是重复的,我也不想要 .htaccess 方式。
标签: javascript php jquery html iframe