完整代码(1)
<script type="text/javascript">
var Login = function () {
return{
init: function () {
this.initEvent();
},
initEvent:function () {
alert("hello!!");
},
initSubmit:function ajax_submit(username) {
var oldPassword = $("#oldPassword").val();
var newPassword = $("#newPassword").val();
var repeatPassword = $("#reNewPassword").val();
$.ajax({
async:false,
type:"post",
url:"/editPassword",
contentType :"application/x-www-form-urlencoded; charset = utf-8",
data:{"username":username, "oldPassword":oldPassword,"newPassword":newPassword},
dataType:"text",
success:function (msg) {
alert(msg.toString());
if (msg == "msg"){
alert("修改成功")
}else {
alert("修改失败")
}
}
});
}
};
}();
$(document).ready(function () {
Logi