如何在用javascript:history.back();返回后自动刷新
1个回答
展开全部
评论信息或评论表单在同一个页面中,但是alert发表成功后源码天空
,返回上一页时却无法自动刷新,只有按了刷新菜单后才能显示出来新发表的评论。
提交评论的代码如下:[code]response.write "<script language='javascript'" & chr(13)
response.write "alert('评论提交成功!');" & Chr(13)
response.write "window.document.location.href='javascript:onclick=history.go(-1)';"&Chr(13)
response.write "</script" & Chr(13)
Response.End[/code]解决方法:response.write "<script language='javascript'" & chr(13)
response.write "alert('评论提交成功!');" & Chr(13)
response.write "window.document.location.href='这里改成上一页的URL地址';"&Chr(13)
response.write "</script" & Chr(13)
Response.End
response.write "<script language='javascript'" & chr(13)
response.write "alert('评论提交成功!');" & Chr(13)
response.write "window.document.location.href='"&Request.ServerVariables("HTTP_REFERER")&"';"&Chr(13)
response.write "</script" & Chr(13)
Response.Endok !后退刷新代码:
[code]<%Response.Expires = -1
Response.cachecontrol = "no-cache"%[/code]放到asp页的开头,再点后退,就会强制刷新..
,返回上一页时却无法自动刷新,只有按了刷新菜单后才能显示出来新发表的评论。
提交评论的代码如下:[code]response.write "<script language='javascript'" & chr(13)
response.write "alert('评论提交成功!');" & Chr(13)
response.write "window.document.location.href='javascript:onclick=history.go(-1)';"&Chr(13)
response.write "</script" & Chr(13)
Response.End[/code]解决方法:response.write "<script language='javascript'" & chr(13)
response.write "alert('评论提交成功!');" & Chr(13)
response.write "window.document.location.href='这里改成上一页的URL地址';"&Chr(13)
response.write "</script" & Chr(13)
Response.End
response.write "<script language='javascript'" & chr(13)
response.write "alert('评论提交成功!');" & Chr(13)
response.write "window.document.location.href='"&Request.ServerVariables("HTTP_REFERER")&"';"&Chr(13)
response.write "</script" & Chr(13)
Response.Endok !后退刷新代码:
[code]<%Response.Expires = -1
Response.cachecontrol = "no-cache"%[/code]放到asp页的开头,再点后退,就会强制刷新..
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询