alert("修改密码成功")
这句代码有效,能弹窗了
但第二句页面跳转的不起作用,还是回到了修改密码本身的页面changepassword.htm,清空了页面内容
以下是js的代码,我担心跳转不到我写的页面,特意让跳转到百度,也不行:
function chgpas(){
var result=submitAjaxFileds("check.htm","","原密码","新密码","确认密码",false);
if (result=="ok"){
alert("密码修改成功!");
location="http://www.baidu.com";
return true;
}
else{
showTopTips("tp1",result,1500);
return false;
}
}
下面是httprequest的相关页面代码:
Case "changepassword.htm"
If e.PostValues.Count=0 Then
WB.AddForm("","fm1","changepassword.htm").attribute=""
wb.AddToptips("","tp1","")
With wb.AddInputGroup("fm1","ipg","修改密码")
.AddInput("原密码","原密码","password")
.AddInput("新密码","新密码","password")
.AddInput("确认密码","确认密码","password")
End With
With wb.AddButtonGroup("fm1","btg1",True)
.Add("确定","确定","submit")
With .Add("取消","取消")
.kind=1
.Attribute = ""
End With
End With
wb.AppendHTML("<script src='./lib/myjs.js'></script>") '引入脚本文件
e.writestring(wb.build)
End If
Case "check.htm"
If e.PostValues.ContainsKey("原密码") = False Then
e.WriteString("请输入原密码!")
End If
If e.PostValues.ContainsKey("新密码") = False OrElse e.PostValues.ContainsKey("确认密码") = False Then
e.WriteString("请输入2次新密码!")
End If
Dim dr As DataRow = DataTables("客户信息表").SQLFind("联系人 = '" & e.Cookies("username") & "'")
If dr IsNot Nothing Then
If dr("密码") <> e.PostValues("原密码") Then
e.writestring("原密码错误!")
End If
End If
If e.PostValues("新密码") <> e.PostValues("确认密码") Then
e.writestring("2次新密码不一致!")
End If
e.WriteString("ok")
请老师指点。