摘要: js正则判断例子 var str666 = 'long long age'; var reg = new RegExp("[\\u4E00 \\u9FFF]+","g"); if(reg.test(str666)){ console.log("有汉字"); }else{ console.log("无 阅读全文
posted @ 2018-01-16 16:47 小酱油 阅读(4653) 评论(0) 推荐(0) 编辑
摘要: jq clone 复制时候出现重复数据问题 今天在处理一个列表页面的时候,遇到了需要clone来解决的问题,当完成代码后,测试,发现有个奇葩问题,对同一列数据连续做clone处理时,数据成倍的被复制,百思不得其解,经过反复调试,终于找到了原因。 图中: 点击 dom 1 ,弹出克隆的数据。当点击do 阅读全文
posted @ 2018-01-16 16:45 小酱油 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 无聊的时候也可以写着玩 function substrtext($text, $length) { if(mb_strlen($text, 'utf8') $length) return mb_substr($text, 0, $length, 'utf8').'...'; return $text 阅读全文
posted @ 2018-01-16 16:41 小酱油 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 瀑布流页面 <!DOCTYPE html 瀑布流布局 all{ position: relative; } .box{ float: left; } .pic img{ width: 150px;/ 这里控制宽度 / height: auto; } $(window).load(function() 阅读全文
posted @ 2018-01-16 16:40 小酱油 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 在《JavaScript高级程序设计》一书有介绍函数节流,里面封装了这样一个函数节流函数: function throttle(method, context) { clearTimeout(methor.tId); method.tId = setTimeout(function(){ metho 阅读全文
posted @ 2018-01-16 16:39 小酱油 阅读(4017) 评论(0) 推荐(0) 编辑
摘要: 加载三个js插件 简单代码:操作一块元素的上下位移。 $(" js_showdown_show").on("swipeDown",function(){ $(".js_showdown").stop(); $(" js_showdown_show").stop(); $(this).animate( 阅读全文
posted @ 2018-01-16 16:38 小酱油 阅读(1913) 评论(0) 推荐(0) 编辑
摘要: touch :touchstart、touchend、touchmove $("body").on("touchstart", function(e) { e.preventDefault(); startX = e.originalEvent.changedTouches[0].pageX, st 阅读全文
posted @ 2018-01-16 16:38 小酱油 阅读(354) 评论(0) 推荐(0) 编辑
摘要: //导入方法 public function importdata(){ $file = './a.excel'; if (!file_exists($file)) { $re['msg'] = '模板文件出错,请重新上次模板文件'; } / Include PHPExcel / require_o 阅读全文
posted @ 2018-01-16 16:37 小酱油 阅读(172) 评论(0) 推荐(0) 编辑
摘要: var lists = <?php echo $scannerlist;? ; var js_getCityUrl = "{:U(MODULE_NAME.'/ScannerManager/getCity','','',true)}"; var js_getMapUrl = "{:U(MODULE_N 阅读全文
posted @ 2018-01-16 16:35 小酱油 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 用法: 1、drop table tb drop将表格直接删除,没有办法找回 2、truncate (table) tb 删除表中的所有数据,不能与where一起使用 3、delete from tb (where) 删除表中的数据(可制定某一行) truncate和delete的区别 1、事务:t 阅读全文
posted @ 2018-01-16 16:34 小酱油 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 获取起点(touchstart)Y轴坐标与终点(touchend)Y轴坐标,如果起点大于终点那么就去执行取消操作 :坐标起点是浏览器左上角,所以往上滑动的话,起点坐标大于终点坐标。 点击长按啊 JS:// var btnElem=document.getElementById("loading"); 阅读全文
posted @ 2018-01-16 16:34 小酱油 阅读(2685) 评论(0) 推荐(0) 编辑
摘要: / 中国正常GCJ02坐标 百度地图BD09坐标 腾讯地图用的也是GCJ02坐标 @param double $lat 纬度 @param double $lng 经度 / public function Convert_GCJ02_To_BD09($lat,$lng){ $x_pi = 3.141 阅读全文
posted @ 2018-01-16 16:33 小酱油 阅读(9300) 评论(0) 推荐(0) 编辑
摘要: 例子: array( "id"= "1208", "fromid"= "2", "froms"= "strategy", "name"= "", "sort"= "1" ), 1= array( "id"= "1209", "fromid"= "3", "froms"= "strategy", "n 阅读全文
posted @ 2018-01-16 16:33 小酱油 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 顺序安装:linux apache mysql php Linux 这个就不多说明了... CentOS 6.5 镜像 虚拟机安装 一次性安装开发工具: yum groupinstall "Development tools" or: yum y groupinstall "Development 阅读全文
posted @ 2018-01-16 16:32 小酱油 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1、用jquery判断checkbox $('.checkbox').prop('checked'); 这里,会返回一个object ,true、false ; 所以: f($('.checkbox').prop('checked')==true){ alert('选中'); }else{ aler 阅读全文
posted @ 2018-01-16 16:30 小酱油 阅读(666) 评论(0) 推荐(0) 编辑
摘要: 通常jquery的submit表单提交是不会被拦截的,但是用jquery ajax异步提交是会被拒绝的,既然是异步提交造成的问题,那就好解决了,因为jquery ajax方法提供了参数选项: async :true, 默认设置下,所有请求均为异步请求。如果需要发送同步请求,请将此选项设置为 fals 阅读全文
posted @ 2018-01-16 16:29 小酱油 阅读(885) 评论(0) 推荐(0) 编辑
摘要: 最新写法:CSS3,不兼容IE8 position: fixed; top: 50%; left: 50%; width: 50%; max width: 630px; min width: 320px; height: auto; z index: 2000; visibility: hidden 阅读全文
posted @ 2018-01-16 16:18 小酱油 阅读(206) 评论(0) 推荐(0) 编辑
摘要: //时间的计算与转换 一: echo date('Y m d',strtotime(' 5 day')); 二:两种想写法,效果一样。 echo date('Y m d H:i:s',strtotime("+8 hour",strtotime('2016 10 14 10:15:00') )); e 阅读全文
posted @ 2018-01-16 16:17 小酱油 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 栗子:判断字符中是否存在大小写和数字; 阅读全文
posted @ 2018-01-16 16:16 小酱油 阅读(625) 评论(0) 推荐(0) 编辑
摘要: 一、Model+数据库的切换使用 //也许用到了命名空间,举个例子 namespace Model\User; use \Think\Model; class User extends Model{ //继承tp的基类 } 方法一:使用ThinkPHP的初始化方法_initialize(); pub 阅读全文
posted @ 2018-01-16 16:15 小酱油 阅读(384) 评论(0) 推荐(0) 编辑