• javascript中window.open()与window.location.href的区别


    window.open("index.aspx",'top'); 只是表示打开这个页面,并不是打开并刷新index.aspx

    window.location.href="index.aspx"; 表示重新定向到新页面,同时刷新打开的这个页面;

    eg:

    <tr><td style="96%;">进行中项目</td><td><img alt="" src="Images/2emorewe.gif" style="text-align:right;cursor:hand;"

    onclick="javascript:window.open('ProjectList.aspx?flag=0','_top');"/></td></tr>  

    <tr><td style="96%;">进行中项目</td><td><img alt="" src="Images/2emorewe.gif" style="text-align:right;cursor:hand;" onclick="javascript:window.location.href='ProjectList.aspx?flag=0';"/></td></tr>

    这两个的效果不同

  • 相关阅读:
    10.11-10.16
    10.8-10.10
    9.26-28
    9.29css继承属性
    表单的学习
    排版
    css补充
    今天学的新内容
    新内容
    文本样式的修改
  • 原文地址:https://www.cnblogs.com/a757956132/p/4589385.html
Copyright © 2020-2023  润新知