ie6 bug target="_top" 不起作用(原因是跨域,ie6会更加严格,当都添加可信任站点时问题解决。)
html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
<body>
<iframe src="http://bemmu4.appspot.com/static/iframe.html"/>
</body>
</html>
iframe
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
<body>
<a href="http://www.google.com" target="_top">Let's go to Google!</a>
</body>
</html>
解决方法:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
<body>
<a href="http://www.google.com" target="_top" οnclick="javascript:if(window.top){window.top.location='http://www.google.com';}">Let's go to Google!</a>
</body>
</html>