窗口的历史回到(-1)不工作 [英] window history back (-1) not working

查看:154
本文介绍了窗口的历史回到(-1)不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下使用code到背面为previous页,但它不工作。警告框弹出仍然连我在页面上单击OK。
居然还有有3页包括此窗口页面code。第1页是用户需要填写的表格是名redeem_newcust.asp和动作应该所有的数据保存到名为redeem_newcustDB.asp数据库。在页面redeem_newcustDB.asp有一个code选择类型赎回选项,则该页面将指向动作页面redeem_newprocess.asp与包括如下code。意味着当类型赎回不等于生日包 - PDV RM50的用户点击那么它应该回到previous页面,这意味着页面redeem_newcustDB.asp。
这是可能的有回到那个previous页..?如果B就不需要把所有的价值?
请帮帮忙,谢谢

 如果redeemtype =生日包 -  PDV RM50,那么
        Response.Redirect(\"redeem_newbirth.asp?cardno=\"&BlinkCard&\"&redeemtype=\"&redeemtype&\"\")
    其他
        %GT;
            < SCRIPT LANGUAGE =JavaScript的>
            <! -
            window.alert(请选择赎回的类型);
            window.history.go(-1);
            // - >
            < / SCRIPT>
        <%
万一%GT;


解决方案

我总是避免使用警报(),因为它在某些浏览器杀死脚本。我会的open()一个新的窗口和 ButtonElement.onclick 使用位置=

请注意:

窗口是隐式的,这样你就不需要写 window.open() window.location的。此外,它的罚款离开了 .href 参考 location.href

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

%>

解决方案

I would always avoid using alert(), since it kills script in some Browsers. I would open() a new window and ButtonElement.onclick use location =.

Note:

window is implicit, so you don't need to write window.open() or window.location. Additionally, it's fine to leave off .href when referring to location.href

这篇关于窗口的历史回到(-1)不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆