javascript中window.open()与window.location.href的区别
2017-05-20 17:21
477 查看
window.open("index.aspx",'top'); 只是表示打开这个页面,并不是打开并刷新index.aspx
window.location.href="index.aspx"; 表示重新定向到新页面,同时刷新打开的这个页面;
eg:
<tr><td style="width: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="width: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>
这两个的效果不同
参考:http://blog.csdn.net/lingling_jy/article/details/8191107
window.location.href="index.aspx"; 表示重新定向到新页面,同时刷新打开的这个页面;
eg:
<tr><td style="width: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="width: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>
这两个的效果不同
参考:http://blog.csdn.net/lingling_jy/article/details/8191107
相关文章推荐
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript 打开页面window.location.href和window.open的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- 发现的window.open() 和location.href的区别。
- window.location和window.open的区别[JavaScript]
- window.location.href和window.open的几种用法和区别
- window.location.href和window.open的几种用法和区别
- javascript 打开页面window.location和window.open的区别
- window.location.href和window.open的几种用法和区别
- window.location.href,window.open,<a href="/"></a>打开新页面区别
- window.location.href()与window.open()区别
- window.location与window.open()的区别 "top.location.href"是最外层的页面跳转
- window.location.href和window.open的几种用法和区别
- window.location.href和window.open的几种用法和区别