---
title: "如何禁止被iframe包含"
author: "limon87"
date: "2013-04-23T09:29:28Z"
tags: []
categories: ["Web前端"]
slug: "iframe"
draft: false
lastmod: "2013-04-23T09:29:28Z"
id: 1851771
url: "https://limon87.iteye.com/blog/1851771"
---

```
//不允许iframe嵌入 
if(window.top !== window.self){ window.top.location = window.location;}
```