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" onclick="javascript:if(window.top){window.top.location='http://www.google.com';}">Let's go to Google!</a>
    </body>
</html>

 

相关文章:

  • 2021-10-21
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2021-05-30
  • 2021-11-01
  • 2021-11-24
  • 2022-01-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2021-11-30
  • 2021-12-25
相关资源
相似解决方案