如何实现 密码修改成功后 先给出提示,弹出个小窗口, 然后自动跳转主界面, 

解决方案 »

  1.   

    这个你用ajax 的话 ,在回调函数里面
    if(success){
    alert("xxxx");
    location.href ="xxxxx页面";
    }用form表单的话,
    可以让后台控制一下成功返回
    response.write("<script>alert(xxx);location.href=xxxx</script>");
    失败的话
    response.write("<script>alert(xxx);history.back();</script>");
      

  2.   

    其实不需要什么,就是做一个modal,数据提交到后台,返回成功后,用一个一次性定时器,设置modal显示,清除定时器,再执行跳转就行
    var timer1=null;
    $.ajax({
    .....
    ....
    success:function(){
    $("#XXXmodal").show();
    if(timer1!=null){
    clearTimeout(timer1);
    }
    timer1=setTimeout(func(){
    $("#XXXmodal").hide();
    window.open("xxx.html","_self");
    },2000
    );
    },
    error:function(){}
    }