随笔分类 -  代码仓库

常用不常用的,存起来再说
摘要:0) { $where=' and '.implode(' and ',$wherelist); $url='&'.implode('&',$urllist); } //分页的实现原理 //1.获取数据表中总记录数 $sql="select * from menu_message,menu_type where menu_message.typeid=menu_... 阅读全文
posted @ 2017-03-31 14:06 狰狞蛋子 阅读(309) 评论(0) 推荐(0)
摘要:整数或者小数:^[0-9]+\.{0,1}[0-9]{0,2}$只能输入数字:"^[0-9]*$"。只能输入n位的数字:"^\d{n}$"。只能输入至少n位的数字:"^\d{n,}$"。只能输入m~n位的数字:。"^\d{m,n}$"只能输入零和非零开头的数字:"^(0|[1-9][0-9]*)$"。只能输入有两位小数的正实数:"^[0-9]+(.[0-9]{2})?$"。只能输入有1~3位小数的正实数:"^[0-9]+(.[0-9]{1,3})?$"。只 阅读全文
posted @ 2014-02-24 21:35 狰狞蛋子 阅读(132) 评论(0) 推荐(0)
摘要:1、禁用页面的右键菜单$(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); });2、新窗口打开页面$(document).ready(function(){ $('a[href^="http://"]').attr("target","_blank"); $("a[rel$='external']").click(function() 阅读全文
posted @ 2014-01-04 01:29 狰狞蛋子 阅读(227) 评论(0) 推荐(0)
摘要:Home 1 12 123 1234 12345 123456 12345678 123456789 1234567890 12345678901 123456789012 *{margin:0;padding:0}body{font:14px Georgia}header{paddin... 阅读全文
posted @ 2013-12-19 22:12 狰狞蛋子 阅读(267) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-12-11 22:19 狰狞蛋子 阅读(190) 评论(0) 推荐(0)
摘要:/// /// 将指定字符串按指定长度进行剪切 /// /// 需要截断的字符串 /// 字符串的最大长度 /// 超过长度的后缀 /// 如果超过长度,返回截断后的新字符加上后缀,否则返回原字符串 public static string StringTruncat(string oldStr, int maxLength, string endWith) { if(string.IsNullOrEmpty(oldStr)) ... 阅读全文
posted @ 2013-12-10 01:53 狰狞蛋子 阅读(180) 评论(0) 推荐(0)