• jsp跳转后台代码页的简易方式~


    jsp跳转到代码隐藏页。有几种方法,例如,:

        action方式;

       jquery方式,码如下面:

    function regCust(){
            $('#containerFRM').form(
                    'submit',
                    {
                        "url" : "${webAppUrl}/cust/registeredUser.html",
                        onSubmit : function() {
                            //显示遮罩
                            $.jBox.tip("正在提交……", 'loading');
                        },
                        success : function(responseText) {
                            $.jBox.closeTip();
                            if('success' == responseText){
                                /*$.jBox.tip("注冊成功,3秒后自己主动跳转……", 'success');
                                window.setTimeout(function () {
                                    window.location.href = document.getElementById('strBackUrl').value
                                }, 3000);*/
                                
                                $('.themsMain').html("<div style='height: 100px;margin-top: 50px;text-align: center;font-weight: bold;font-size: 16px;line-height:36px;'><img src='${webUiUrl}/images/chengg.jpg' width='64' height='59' /><span class='red bold font16'>恭喜您,注冊成功!

    </span><br />系统<span id='time_span'>3</span>秒之后自己主动跳转...<div><div>");
                                window.opener.location.reload();
                                interValObj = window.setInterval(setTime, 1000);
                            }else{
                                $.jBox.error('注冊失败', '提示');
                            }
                            
                    }
            },'text');
        }

      ajax方式。如今来说说ajax方式,代码例如以下:

    $.ajax({
                url:"${webAppUrl}/cust/existsUser.html?user_sn="+s,
                type : "post",
                dataType : "text",
                contentType : "application/text;charset=utf-8",
                cache : false,
                async : false,
                success : function(data) {
                    if('false' == data || !data)
                    {
                        regCust();
                    }else{
                        $.jBox.info('username已经存在,请又一次输入', '提示');
                    }
                }
            },'text');

    版权声明:本文博主原创文章,博客,未经同意不得转载。

  • 相关阅读:
    联赛模拟测试22 D. 简单计算
    联赛模拟测试22 B. 分组配对 倍增+二分
    斜率优化DP总结
    洛谷 P5490 【模板】扫描线
    容斥原理学习笔记
    联赛模拟测试20 C. Weed 线段树
    联赛模拟测试20 B. Walk (建图)
    联赛模拟测试20 A. Simple (数学)
    洛谷 P2617 Dynamic Rankings 树套树
    社区团购模式
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/4856271.html
Copyright © 2020-2023  润新知