問題描述
我使用下面的代碼返回上一頁,但它不起作用.即使我在頁面上單擊確定",警報框仍會彈出.實際上有 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)不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!