Created
October 12, 2016 07:17
-
-
Save ufologist/504c52cec4d9135a9d6762c687e13a0b to your computer and use it in GitHub Desktop.
iframe 页面中的链接可以让父级页面重定向, 要防止这种情况, 可以通过 iframe 的 sandbox 属性来控制.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>页面 B</title> | |
</head> | |
<body> | |
<h1>页面 B</h1> | |
<ul> | |
<li><a href="http://baidu.com">X度</a></li> | |
<li><a href="http://baidu.com" target="_top">X度 target="_top" 可以重定向父级页面</a></li> | |
</ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment