社区
JavaScript
帖子详情
请问如何区别window.location.Reload()和window.location.href=window.location.href;
guiguigz
2007-10-25 10:14:57
如题:
请问如何区别window.location.Reload()和window.location.href=window.location.href;
两者之间对参数是如何处理的?有区别吗?
谢谢
...全文
32226
19
打赏
收藏
请问如何区别window.location.Reload()和window.location.href=window.location.href;
如题: 请问如何区别window.location.Reload()和window.location.href=window.location.href; 两者之间对参数是如何处理的?有区别吗? 谢谢
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
19 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ccssddnn
2011-12-08
打赏
举报
回复
window.location.Reload()重新加载当前文档。window.location.href设置或返回完整的 URL。
zjq8888882009
2011-07-25
打赏
举报
回复
2 3 15楼都说的都挺好的
小纯洁001
2011-07-25
打赏
举报
回复
学习了!
xdyouxirensheng
2010-12-27
打赏
举报
回复
支持15楼
flyerwing
2010-12-27
打赏
举报
回复
定义和用法
reload() 方法用于重新加载当前文档。
语法
location.reload(force)说明
如果该方法没有规定参数,或者参数是 false,它就会用 HTTP 头 If-Modified-Since 来检测服务器上的文档是否已改变。如果文档已改变,reload() 会再次下载该文档。如果文档未改变,则该方法将从缓存中装载文档。这与用户单击浏览器的刷新按钮的效果是完全一样的。
如果把该方法的参数设置为 true,那么无论文档的最后修改日期是什么,它都会绕过缓存,从服务器上重新下载该文档。这与用户在单击浏览器的刷新按钮时按住 Shift 健的效果是完全一样。
好象是说:
如果window.loacation.reload(true)==window.location.href="xxx.xx";
gongjie416
2010-12-27
打赏
举报
回复
支持3楼
licip
2010-12-27
打赏
举报
回复
2楼说的很对。
弑夜
2010-12-27
打赏
举报
回复
可以设定时间限制吗 可以怎么设
浴火_凤凰
2010-11-18
打赏
举报
回复
window.location.Reload(); 有参数的
韭菜猫骑士
2010-11-18
打赏
举报
回复
还能回复这么古老的帖子么?try
davidtps
2010-09-23
打赏
举报
回复
学习·········
caixiajia
2010-07-19
打赏
举报
回复
学习了,呵呵
fosjos
2008-07-08
打赏
举报
回复
reload参数有true和false,比较有意思
sherry7
2008-07-07
打赏
举报
回复
十第分秒十毫分 第分秒十度毫第分
fuyou001
2008-06-25
打赏
举报
回复
学习了
fisherxu
2008-06-25
打赏
举报
回复
支持
nicholsky
2007-10-25
打赏
举报
回复
楼上说得对,上次有个人跟我说过,我后来就懂得区分他们的用法了,最好不要用location.reload(),而用location=location比较好,还有在模式窗口(showModalDialog和showModelessDialog)前者不能用。
rjzou2006
2007-10-25
打赏
举报
回复
window.location.Reload()应该是刷新.(如果有数据提交的话,会提示是否提交的(是和否选项))
window.location.href=window.location.href;
是定向url提交数据
是大的区别还是是否提交数据了
s_liangchao1s
2007-10-25
打赏
举报
回复
window.location.Reload()和window.location.href=window.location.href;都是刷新当前页面。
window.location
.
href
页面跳转的用法(
区别
于redirect)
window.location
.
href
页面跳转的用法(
区别
于redirect)
详解js location.
href
和window.open的几种用法和
区别
.docx
详解js location.
href
和window.open的几种用法和
区别
.docx
jsp 刷新父页面
用iframe、弹出子页面刷新父页面 iframe parent.location.
reload
(); 弹出子页面 window.opener.location.
reload
(); 子窗口刷新父窗口 self.window.opener.locaction.
reload
(); 刷新一open()方法打开的窗口 window.opener.location.
href
= window.opener.location.
href
刷新以winodw.showModelDialog()方法打开的窗口 window.parent.dialogArguments.document.execCommand('Refresh'); 或 Response.Write("<script>
window.location
.
href
=
window.location
.
href
window.location.
href
=
window.location
.
href
; window.location.
href
=
window.location
.
href
;window.opener.location=window.opener.location;
location.
href
语句与火狐不兼容的问题
使 用了一个点击按钮跳转的js,语句很简单: <input type=”button” value=”添加” onclick=”location.
href
(‘//www.jb51.net);” /> 测试的时候发现其在IE下是可以用的而firefox则不能使用了。于是我在location前面加了一个 window,即改为: onclick=”[removed].
href
(‘http://baidu.com’);” 发现仍然不行。 于是去baidu之,找到一个答案: 使用[removed]=”url”; 代替 location.
href
(‘url’);” 于是将源程序改为
关闭时刷新父窗口两种方法
window.opener.location.
reload
()刷新父窗口window.opener.location.
reload
() 与 window.opener.location.
href
=window.opener.location.
href
都是弹出窗口关闭时用来刷新父窗口。 但[removed].
Reload
如果有数据提交的动作,会提示是否提交的(是和否选项) window.opener.location.
href
=window.opener.location.
href
是定向url提交数据,则不会出现是和否 的选择框。
JavaScript
87,996
社区成员
224,708
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章