正文  软件开发 > html5 >

WebApp之H5登录注册,webapp登录注册

WebApp之H5登录注册,webapp登录注册代码indexhtml <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <t...

WebApp之H5登录注册,webapp登录注册

代码indexhtml

<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>TencentQQ</title>
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
		<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
		<script type="text/javascript" src="js/index.js" ></script>
	</head>

	<body>
		<!--登陆页面-->
		<div data-role="page" id="pageLogin">
			<div data-role="header">
				<h1 role="heading">Tencent办公系统</h1>
			</div>
			<div data-role="main" class="ui-content">
				<form method="get" action="">
					<div class="ui-field-contain">
						<label for="name">帐号:</label>
						<input type="text" name="u_name" id="u_name">
						<br/>
						<label for="password">密码:</label>
						<input type="password" name="u_password" id="u_password">
						<div>//测试登录
function login() {
	var u_user = document.getElementById("u_name").value;
	var u_password = document.getElementById("u_password").value;
	if((u_user == "admin") && (u_password == "admin888")) {
		alert("登录成功!不作处理!");
	} else {
		alert("用户名或者密码错误,登录失败!");
		location.href = "index.html#pageLogin";
	}
}
//测试注册
function register() {
	var u_user1 = document.getElementById("u_name1").value;
	var u_password1 = document.getElementById("u_password1").value;
	var u_password2 = document.getElementById("u_password2").value;
	if((u_user1 == "root") && (u_password1 == "123456") && (u_password2 == u_password1)) {
		alert("注册成功!返回登录页面!");
		location.href = "index.html#pageLogin";
	} else {
		alert("注册失败,返回登录页面!");
		location.href = "index.html#pageLogin";
	}
}

  

http://www.bkjia.com/HTML5/1224248.htmlwww.bkjia.comtruehttp://www.bkjia.com/HTML5/1224248.htmlTechArticleWebApp之H5登录注册,webapp登录注册 代码indexhtml !DOCTYPE htmlhtmlheadmeta charset="utf-8"titleTencentQQ/titlemeta name="viewport" content="width=device-width,initial-s...