黑马旅游网总结
操作流程分析:
注册–登陆–导航–分页–详情页–收藏
注册的实现
1 注册的校验:
用户名密码邮箱的校验:页面的校验 js/jquery实现,正则,样式,
表单校验:如果是button/submit, a /javaScript:void(0),表单校验的两种方式:
1 .按钮绑定单击事件,if(条件){绑定表单的提交事件}
2.给表单绑定提交事件:return true提交/false不提交,但是return之前的代码会执行,比如ajax的异步校验
表单:request.getparameter(“表单中name的值”),返回的是该表单中value的值
超连接:request.getparameter(“连接中key”),获取到的是key对应的值
$(this).serialize(),将表单中的数据序列化成字符串。应该分为表单和超链接参数的封装
数据封装思想:flag标志,data封装的数据,msg 提示消息
location.href(“路径”) 相对/绝对路径都可以
验证码判断:if是在一个方法中,如果验证码不满足,可以用return直接终结方法
表单数据封装/数据库查询信息的封装:查询到的信息可以比Bean多,多余的丢掉
邮箱激活的思路:用户注册的时候,给用户一个标记N,并且给用户发送邮件,邮件里的超链接访问一个servlet,通过servlet改变标记
2 登陆
登陆:if判断用户是否为null,如果为null,那么异步返回信息 return,