Skip to content

Instantly share code, notes, and snippets.

@huobazi
Forked from huacnlee/gist:505647
Created May 16, 2011 03:00
Show Gist options
  • Save huobazi/973849 to your computer and use it in GitHub Desktop.
Save huobazi/973849 to your computer and use it in GitHub Desktop.
// 限制必须在iframe里面打开页面
// 此方法用户浮动iframe窗口的页面做限制,只有通过iframe才可以打开页面
// 禁止在iframe外打开
if (top.location == self.location) {
location.href = "/";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment