摘要: 1 (function(){ 2 //select操作 3 $.fn.loadSelect = function(opt){ 4 opt = $.extend({}, { 5 required:false,//为真则添加required值... 阅读全文
posted @ 2013-12-11 23:39 无嗔 阅读(6955) 评论(0) 推荐(0) 编辑
摘要: chrome 31删除输入框的历史记录TMD居然要用Shift + delete 了.... 为毛!!! 阅读全文
posted @ 2013-12-03 19:17 无嗔 阅读(1748) 评论(0) 推荐(0) 编辑
摘要: 在thinkphp里,链接缓存函数只有cache,如$Model->cache(true)->select(); 但只支持select方法和其派生的函数, 这里我改了一下缓存方法,可以用D和M方法调用的任意函数 文件/common/cacheModel.php 1 model = $fun;3... 阅读全文
posted @ 2013-05-27 22:27 无嗔 阅读(973) 评论(0) 推荐(0) 编辑
摘要: 1 var d ={queue: false, duration: 500}2 $('body').animate( {} ,d);3 $('body').animate( {} ,d);4 console.log(d)5 return 运行以上代码, firebug会报too much re... 阅读全文
posted @ 2013-04-17 10:51 无嗔 阅读(1199) 评论(0) 推荐(0) 编辑
摘要: html5上传图片时可用php://input的数据流来运作. 例如: 1 if($in = fopen('php://input', "rb"))2 while($buff = fread($in, 4096))3 fwrite('e:\\1.jpg', $buff);... 阅读全文
posted @ 2013-04-02 17:32 无嗔 阅读(1983) 评论(0) 推荐(0) 编辑
摘要: 国内很多虚拟主机都会禁用gzinflate等zlib等函数,可以用php5的filter方法绕过. 相信大多用goagent的人都是直接用gae,很少直接用php,但有些场景也会用到比如,gae挂了,国内代理下干点什么事.. 以下代码需运行在php5及以上.. 1 if(!functio... 阅读全文
posted @ 2013-03-12 09:31 无嗔 阅读(949) 评论(0) 推荐(1) 编辑
摘要: LZ77: 是一种基于字典的无损数据压缩算法(还有 LZ78, LZW 等) deflate: 也是一种数据压缩算法,实际上就是先用 LZ77 压缩,然后用霍夫曼编码压缩 gzip: 是一种文件结构,也可以算一种压缩格式,通过 defalte 算法压缩数据,然后加上文件头和adler32校验 zli... 阅读全文
posted @ 2013-03-09 16:15 无嗔 阅读(3747) 评论(2) 推荐(0) 编辑
摘要: 1 function getDatetime(){2 var dt = new Date();3 return (dt.getFullYear()+'-'+(dt.getMonth()+1)+'-'+dt.getDate()+' '+dt.getHours()+':'+dt.ge... 阅读全文
posted @ 2013-01-26 17:04 无嗔 阅读(3176) 评论(1) 推荐(0) 编辑
摘要: 1 //outerHTML方法2 $.fn.outerHTML = function(){3 var $t = $(this);4 return ("outerHTML" in $t[0]) ? $t[0].outerHTML : $t.clone().w... 阅读全文
posted @ 2013-01-25 10:49 无嗔 阅读(481) 评论(0) 推荐(0) 编辑
摘要: php_value name value设置指定的值. 只适合于 PHP_INI_ALL 和 PHP_INI_PERDIR 类型指令. 清除之前设置的值使用 none 标记. Note: 不要使用 php_value 设定布尔值和php_flag (见下文) . php_flag na... 阅读全文
posted @ 2012-12-30 09:56 无嗔 阅读(2688) 评论(0) 推荐(0) 编辑
摘要: 只能临时用用..千万别直接放在生产环境中... 1 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 一些长文字19 20 21 22 23 24 ... 阅读全文
posted @ 2012-11-15 11:26 无嗔 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 用require载入一个带有header('Content-Type: text/html; charset=utf-8');的文件时会出错..直接apache死掉,错误都不抛. 原因居然是因为html;后的空格!! 改成header('Content-Type: text/html;charset... 阅读全文
posted @ 2012-11-11 02:24 无嗔 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 用php框架开发中,经常要用到acl, 手动一个一个录入控制器,动作,描述 到数据库太麻烦.. 以下代码,复制到测试控制器上,前提是你的函数名都是规范的phpdoc格式, 如下格式: 1 /** 2 * 生成acl 3 */ 4 function m... 阅读全文
posted @ 2012-10-21 00:27 无嗔 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: 1 _tips.next('.btnWrap').find('a>img').click(function(){ 2 var call = $(this).attr('class'); 3 try{ 4 //if(... 阅读全文
posted @ 2012-10-11 14:25 无嗔 阅读(4880) 评论(0) 推荐(0) 编辑
摘要: 项目中可以经常要生成tree结构, 一般都是从数据库里读父子表, 方式很多种,哪种最好呢? 下面举个示例: 数据库: 1 -- 2 -- 表的结构 `oa_group` 3 -- 4 5 CREATE TABLE IF NOT EXISTS `oa_group` ( 6 `id` int... 阅读全文
posted @ 2012-10-07 21:49 无嗔 阅读(4142) 评论(0) 推荐(0) 编辑