MUI架構編寫修改密碼頁面並且ajax請求後台資料拿到介面完成修改密碼功能

來源:互聯網
上載者:User

標籤:meta   ref   success   lock   傳值   pos   hid   ice   post   

 

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">

<title>修改密碼</title>
<link rel="stylesheet" href="css/mui.min.css"/>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/password_change.css"/>
<link rel="stylesheet" href="css/iscroll.css"/>

</head>
<body>
<header class="mui-bar mui-bar-nav" style="display: block;height: 64px;padding-top:20px">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">修改密碼</h1>
</header>
<div id="wrapper">
<div id="scroller" style="transform-origin: 0px 0px 0px; transition-timing-function: cubic-bezier(0.1, 0.57, 0.1, 1); transition-duration: 0ms; transform: translate(0px, 0px) scale(1) translateZ(0px);">
<div class="mui-content"style="padding-top: 64px;">
<div class="mui-content-padded" style="margin: 0px;margin-top: 14px">
<form class="mui-input-group">
<div class="mui-input-row">
<input type="password" class="mui-input-clear" placeholder="請輸入舊密碼" id="oldpwd">
</div>
<div class="mui-input-row">
<input type="password" class="mui-input-clear" placeholder="請輸入新密碼" id="newpwd">
</div>
<div class="mui-input-row">
<input type="password" class="mui-input-clear" placeholder="請再次輸入新密碼"id="newpwdagain">
</div>
</form>
</div>
<button type="button" class="mui-btn mui-btn-primary mui-btn-block content_btn" onclick="submit()">完成</button>
</div>

</div>
</div>
<script src="js/mui.min.js "></script>
<script src="js/jquery.min.js"></script>
<script>
//跳轉頁面方法
function showpage(x,y)
{
mui.openWindow({
url: x,
id: y,
preload: true,
show: {
aniShow: ‘pop-in‘
},
styles: {
popGesture: ‘hide‘
},
waiting: {
autoShow: false
}
});
}

</script>
<script type="text/javascript" src="js/iscroll.js"></script>
<script type="text/javascript">
//調用下拉滑動彈回效果
var Scroll = new iScroll(‘wrapper‘,{vScroll: true,hScrollbar:false});
//ajax非同步請求驗證與修改密碼
function submit(){
//開始傳值請求
var guid="501A73825438A410E050007F01003B83";
var OldPass=$(‘#oldpwd‘).val();
var NewPass=$(‘#newpwd‘).val();
var url = "這裡放後台給你的借口地址URL哦!!!"
//首先判斷密碼框是否為空白
var newpwdagain=$(‘#newpwdagain‘).val();
if(OldPass==""){
alert(‘舊密碼不可為空‘);
}
if(NewPass==""||newpwdagain==""){
alert(‘新密碼不可為空‘);
}else{
$.ajax({
type: "post",
url: url,
success: function(result){
result = result.trim();
result = result.replace(/\n/g,‘‘);
alert(result);
}
});
}

}
</script>
</body>
</html>

MUI架構編寫修改密碼頁面並且ajax請求後台資料拿到介面完成修改密碼功能

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.