zoukankan      html  css  js  c++  java
  • ie6下iframe中里使用target="_top" 链接失效

    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>
    
  • 相关阅读:
    docker搭建主从复制mysql
    mysql主从复制(mariadb)
    docker搭建mysql8.0
    docker安装mysql
    终端配置kxsw
    AJAX教程
    移动端常见布局
    css为什么需要精灵图
    元素的显示与隐藏
    css网页布局总结
  • 原文地址:https://www.cnblogs.com/cheche/p/1884386.html
Copyright © 2011-2022 走看看