时间:2021-07-01 10:21:17 帮助过:30人阅读
2.form.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MySQL</title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<body>
<form >
用户姓名:<input type="text" name="user_name" value="MySQL"><br>
用户性别:<input type="text" name="user_sex" value="女"><br>
用户住址:<input type="text" name="user_origin" value="phpStudy"><br>
用户电话:<input type="text" name="user_phone" value="110"><br>
用户邮箱:<input type="text" name="user_email" value="869269904@qq.com"><br>
</form>
<div class="keep">保存</div>
</body>
<script type="text/javascript">
$(".keep").on("click",function(){
$.ajax({
url:"/keepUserInformation",
data:$(‘form‘).serialize(),
type:‘GET‘,
success:function(res){
console.log(res);
}
});
});
</script>
</html>
3.
4.
5.
三、express写接口,与数据库举了个简单的列子。
所有复杂的业务逻辑都是由简单的列子组成。理清楚了每一个点,就简单了。
node 的入门篇基本就完了。有兴趣的可以看看ejs,jade模板引擎。
Come On !
var a = {n:2};
var b = a;
a.x = a = {n:1};
b.x ?
a.x ?
express和数据库(MySQL)的交互(二)
标签:doctype oct host post min origin head exp database