Skip to content

Instantly share code, notes, and snippets.

@GeekaholicLin
Last active December 2, 2016 13:09
Show Gist options
  • Select an option

  • Save GeekaholicLin/e024653e8d5e3ed25cf9e8e56afda341 to your computer and use it in GitHub Desktop.

Select an option

Save GeekaholicLin/e024653e8d5e3ed25cf9e8e56afda341 to your computer and use it in GitHub Desktop.
bug-and-solution-2016.12.2

在使用iframe对一些页面进行套用的时候,比如 https://book.douban.com/tag/ ,由于该页面的js原因,总是将嵌套的主页自动跳转到该页面。这样就无法 在原来的主页正常工作。解决方法是

<iframe sandbox=”allow-forms allow-same-origin allow-scripts” src=”...”></iframe> 这样,就可以保证js脚本的执行,但是禁止iframe里的javascript执行top.location = self.location。


参考链接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment