window history back (-1) not working(窗口历史记录(-1)不起作用)
问题描述
我使用下面的代码返回上一页,但它不起作用.即使我在页面上单击确定",警报框仍会弹出.实际上有 3 页包含此 Windows 页面代码.第一页是用户需要填写的表格名称redeem_newcust.asp,操作应该是将所有数据保存到名为redeem_newcustDB.asp的数据库中.在redeem_newcustDB.asp 页面中有一个代码可以选择兑换类型的选项,然后此页面将指向redeem_newprocess.asp 页面的操作,其中包含如下代码.表示当用户点击不等于生日礼包 - PDV RM50"的兑换类型时,它应该返回到上一页,即页面redeem_newcustDB.asp.有可能回到上一页..?b 是否需要带来所有的价值?请帮忙,谢谢
I have use below code to back for the previous page, but it's not working. the alert box still popup even i click ok on the page. actually there have 3 page include this windows page code. 1st page is user need to fill up the form is name redeem_newcust.asp and the action should be save all the data into the database named redeem_newcustDB.asp. In page redeem_newcustDB.asp have one code to select option for type of redemption then this page will point action to the page redeem_newprocess.asp with is included as below code. Means when user click on type of redemption not equal to "Birthday Pack - PDV RM50" then it should be back to the previous page that means page redeem_newcustDB.asp. It's possible to having back to that previous page..? Should b need to bring all the value? Please help, thanks
If redeemtype = "Birthday Pack - PDV RM50" then
Response.Redirect("redeem_newbirth.asp?cardno="&BlinkCard&"&redeemtype="&redeemtype&"")
Else
%>
<script language="javascript">
<!--
window.alert ("Please choose Type of Redemption");
window.history.go(-1);
//-->
</script>
<%
End If
%>
推荐答案
使用:window.history.back()
代替 .go();
http://www.w3schools.com/jsref/met_his_back.asp
或使用:
window.alert("Please choose Type of Redemption");
setTimeout(function(){
window.history.go(-1);
},500);
这篇关于窗口历史记录(-1)不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:窗口历史记录(-1)不起作用
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Flexslider 箭头未正确显示 2022-01-01