history.go和history.back 1的区别

javascript:history.go()和History.back()的区别收藏
javascript:history.go()和History.back()的区别收藏
&input type=button value=刷新 onclick="window.location.reload()"&&input type=button value=前进 onclick="window.history.go(1)"&&input type=button value=后退 onclick="window.history.go(-1)"&&input type=button value=前进 onclick="window.history.forward()"&&input type=button value=后退 onclick="window.history.back()"& 后退+刷新&input type=button value=后退 onclick="window.history.go(-1);window.location.reload()"&在C# Web程序中,如为页面按钮写返回上一页代码this.RegisterClientScriptBlock("E", "&script language=javascript&history.go(-2);&/script&");其中,history.go(-2),要写为-2,因在按钮事件触发前,已刷新一次页面,所以应是-2。Response.Write("&script language=javascript&history.go(-2);&/script&");此处也要写为“-2”。跟直接写脚本的有所不同。history.back()是会上一页i=1history.go(i)去指定的某页如果是history.go(0)那就是刷新这两个属于JS代码,相当于IE的前进、后退功能。具体的用处就要看什么时候需要这个就用上。比如javascript:;" onClick="javascript:tagshow(event, '%E7%94%A8%E6%88%B7');" target="_self"&用户注册时的验证是后台验证,不符合要求的时候就可以用这个,可以最大限度保证用户少重复输入数据。例如:载入页面:&& function onLoadPage(){&&&& if(event.srcElement.tagName=="SPAN"){&&&&&&&& oFrame=top.window.middle.frames[2];&&&&&&&& oTxt=event.srcElement.innerT&&&&&&&& switch(oTxt){&&&&&&&&&&&& case "前 进":&&&&&&&&&&&&&&&& oFrame.history.go(1);&&&&&&&&&&&& case "后 退":&&&&&&&&&&&&&&&& oFrame.history.back();&&&&&&&&&&&& case "刷 新":&&&&&&&&&&&&&&&& oFrame.location.reload();&&&&&&&& }&&&& }}打开一个jsp页面,肯定是用客户端脚本进行刷新了。Javascript刷新页面的几种方法:1 history.go(0)2 location.reload()3 location=location4 location.assign(location)5 document.execCommand('Refresh')6 window.navigate(location)7 location.replace(location)8 document.URL=location.href
发表评论:
TA的最新馆藏javascript:history.go()和History.back()的区别及应用
字体:[ ] 类型:转载 时间:
为提高用户体验度,可能会使用到刷新 前进 后退等相关更能,本文将以此问题详细介绍javascript:history.go()和History.back()的区别及应用,需要的朋友可以参考下
代码如下: &input type=button value=刷新 onclick="window.location.reload()"& &input type=button value=前进 onclick="window.history.go(1)"& &input type=button value=后退 onclick="window.history.go(-1)"& &input type=button value=前进 onclick="window.history.forward()"& &input type=button value=后退 onclick="window.history.back()"& 后退+刷新&input type=button value=后退 onclick="window.history.go(-1);window.location.reload()"&
在C# Web程序中,如为页面按钮写返回上一页代码
代码如下: this.RegisterClientScriptBlock("E", "&script language=javascript&history.go(-2);&/script&");
其中,history.go(-2),要写为-2,因在按钮事件触发前,已刷新一次页面,所以应是-2。
代码如下: Response.Write("&script language=javascript&history.go(-2);&/script&");
此处也要写为“-2”。跟直接写脚本的有所不同。history.back()是会上一页
代码如下: i=1 history.go(i) [html] 去指定的某页 如果是history.go(0)那就是刷新这两个属于JS代码,相当于IE的前进、后退功能。 具体的用处就要看什么时候需要这个就用上。比如用户注册时的验证是后台验证,不符合要求的时候就可以用这个,可以最大限度保证用户少重复输入数据。 例如:载入页面: [code] function onLoadPage(){ if(event.srcElement.tagName=="SPAN"){ oFrame=top.window.middle.frames[2]; oTxt=event.srcElement.innerT switch(oTxt){ case "前 进": oFrame.history.go(1); case "后 退": oFrame.history.back(); case "刷 新": oFrame.location.reload(); } } }
打开一个jsp页面,肯定是用客户端脚本进行刷新了。 Javascript刷新页面的几种方法:
代码如下: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand('Refresh') 6 window.navigate(location) 7 location.replace(location) 8 document.URL=location.href
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具手机APP中使用history.back()的问题 - java小强博客
小强原创文章,java小强个人博客站点
当前位置:
>> 手机APP中使用history.back()的问题

我要回帖

更多关于 history.go 1 back 的文章

 

随机推荐