纯静态登陆注册页面代码块(无API接口)
<!DOCTYPE html>
<html>
<head>
<title>
登陆注册
</title>
<meta charset="utf-8" name="viewport" content="width=device-width" >
<script type="text/javascript">
function getFileUrl(sourceId) {
var url;
if (navigator.userAgent.indexOf("MSIE")>=1) {
url = document.getElementById(sourceId).value;
} else if(navigator.userAgent.indexOf("Firefox")>0) {
url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));
} else if(navigator.userAgent.indexOf("Chrome")>0) {
url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));
}
return url;
}
function preImg(sourceId, targetId) {
var url = getFileUrl(sourceId);
var imgPre = document.getElementById(targetId);
imgPre.src = url;
}
</script>
</head>
<body bgcolor="#708090">
<div class="text" style="text-align: center;">
<h1>用户登录</h1>
</div>
<div class="text" style="text-align: center;">
<p>注册页面</p>
</div>
<table border="4" align="center">
<tr>
<td>姓名</td>
<td><input type="" name=""></td>
</tr>
<tr>
<td>性别</td>
<td>
<input type="radio" name="sex">man
<input type="radio" name="sex">women
</td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name=""></td>
</tr>
<tr>
<td>兴趣爱好</td>
<td>
<input type="checkbox" name="">球
<input type="checkbox" name="">求求
<input type="checkbox" name="">邱秋秋
</td>
</tr>
<tr>
<td>出生年月</td>
<td>
<select name="year">
<option >1991</option>
<option>1992</option>
<option>1993</option>
<option>1994</option>
<option>1995</option>
<option>1996</option>
<option selected="selected">1997</option>
<option>1998</option>
<option>1999</option>
<option>2000</option>
</select>
<select name="month">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</td>
</tr>
<tr>
<td>图片</td>
<td>
<input type="file" name="imgOne" id="imgOne" onchange="preImg(this.id,'photo');" />
<img id="photo" src="https://avatar.csdn.net/8/6/F/3_qq_42275455.jpg" width="200px" height="30px" style="display: block;" alt="" />
</td>
</tr>
<tr>
<td>个人简介</td>
<td><textarea></textarea></td>
</tr>
<tr>
<td align="center"><button>提交</button></td>
<td align="center"><button>重置</button></td>
</tr>
</table>
</body>
</html>