开发过程的学习小记 以防老年痴呆哈哈哈哈
1.think5的获取session
后端$token != Session::get('__token__') 获取token
前端tp5的token获取 {$Request.token}
2.session验证原理页面访问 后台会生成session 保存在服务器端 该session由时间和其他加密成一个token传给页面
提交的时候ajax带上token 后端接收这个token跟服务器的token对比
验证是否一样
生成时间-现在时间==时间差 跟我设置的session的过期时间对比
两个一起验证是否过期
3.checkbox的一些东西
重置 checkbox样式 -webkit-appearance: inherit;
checkbox状态监控 remember_me:$("#remember-me").prop('checked')?1:0,
4.css布局
对于那些类似名片类的布局 建议使用dispaly:inline-block
对每一个子元素设置display:inline-block
然后可通过vertical-align:middle设置每一子元素相互之间上下居中对齐
5.使用transform 进行上下左右居中对齐的时候 在3d情况下 会相差半个像素 导致图像模糊
建议使用transform2d配合 left top
6使用
html_entity_decode():编译富文本编辑器的内容 示例{php echo html_entity_decode($articledetail['assortintroduce'])}
7.p标签内的img元素高度超出问题解决overflow:auto; zoom:1;
8.white-space: nowrap;让div伸出页面 而不然页面整个左右移动
9.插件封装的一种方式
;(function($){
var Slider = function(ele,option){
var self = this;
self._init()
}
Slider.prototype = {
}
Slider.prototype._init = function(){
}
$.fn.slider = function(option){
return new Slider(this,option)
}
})(jQuery)
10.iphone上滚动条的反弹效果-webkit-overflow-scrolling : touch; 解决滚动条滚动
11.cookie
cookie保存在客户端 可用于记住密码之类的操作
session是保存在服务端 表单过期时间