摘要: function getUrlParm(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"), r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null;}eg:http://www.abc.com/index?parname=1234567console.log(getUrlParm(par 阅读全文
posted @ 2013-08-07 13:18 Younger 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 解决办法:安装php-mcrypt libmcrypt libmcrypt-devel这三个库文件1、安装第三方yum源(默认yum源里面没有这几个库文件,不能使用yum安装)#wget http://www.atomicorp.com/installers/atomic #sh ./atomic2、使用yum命令安装#yum install php-mcrypt libmcrypt libmcrypt-devel3、重启系统#service httpd restart现在打开phpMyAdmin登录页面,没有了错误提示,问题解决 阅读全文
posted @ 2013-07-03 11:52 Younger 阅读(2478) 评论(0) 推荐(0) 编辑
摘要: 高级办法,全局控制遍历实现window.onload=function(){ for(var ii=0; ii<document.links.length; ii++) document.links[ii].onfocus=function(){this.blur()}}将其封装为一个函数function fHideFocus(tName){aTag=document.getElementsByTagName(tName);for(i=0;i<aTag.length;i++)aTag[i].hideFocus=true;//for(i=0;i<aTag.length;i++) 阅读全文
posted @ 2013-04-27 12:26 Younger 阅读(264) 评论(0) 推荐(0) 编辑
摘要: Nginx 解决方案:在 /etc/nginx/config.d/mysit.conf文件的 loction \ {} 中添加if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break;}if (-f $requ... 阅读全文
posted @ 2013-04-13 03:02 Younger 阅读(14433) 评论(0) 推荐(1) 编辑
摘要: Wordpress防采集if(!$_SERVER['HTTP_USER_AGENT']) { //判断是否为空AGENTheader("Content-type: text/html; charset=utf-8");echo '不许采集!因为采集的站长MJJ!';exit;}Wordpress启用... 阅读全文
posted @ 2013-04-09 17:01 Younger 阅读(605) 评论(0) 推荐(0) 编辑
摘要: var tagData = "varName";$.post(ajaxPostUrl, eval("({" + tagData + ":1})"));//$.post(url,{name:value})//当name为变量时,使用上面的写法//js滚动条到最底端控制document.getElementByIdx ( 'chatboard').scrollTop=document.getElementByIdx ( 'chatboard').scrollHeight ;function loadImag 阅读全文
posted @ 2012-12-11 14:35 Younger 阅读(231) 评论(0) 推荐(0) 编辑
摘要: ios上input和select标签获得焦点时页面会缩放,这个问题只要给这两个标签加上:focus伪类,把font-size设置成16,就可以解决了 阅读全文
posted @ 2012-12-03 13:39 Younger 阅读(136) 评论(0) 推荐(0) 编辑
摘要: {%foreach $tplData.cntbox as $cntBox%} <div class="op-wisesoft-tab{%$cntBox.inmain%}-{%$cntBox.insub%}"> {%foreach $tplData["app`$cntBox.inmain``$cntBox.insub`"] as $app%} <a href="{%$app.link%}" target="_blank">{%$app.title%}</a> {%/foreach% 阅读全文
posted @ 2012-11-26 18:50 Younger 阅读(228) 评论(0) 推荐(0) 编辑
摘要: $(function() { $("[class^='TextCut']").each(function() { var cutlength = parseInt($(this).attr('class').replace("TextCut", "")); var text = $(this).html().trim(); $(this).attr("title", text); text = (text.length > cutlength + 2) ? (text.subs 阅读全文
posted @ 2012-10-30 13:50 Younger 阅读(1058) 评论(0) 推荐(0) 编辑
摘要: //保留小数点后2位,四舍五入{%assign var="distKM" value="100.345"%}{%$distKM|string_format:"%.2f"%}//echo:100.35 阅读全文
posted @ 2012-09-06 15:56 Younger 阅读(151) 评论(0) 推荐(0) 编辑
摘要: //获取字符串长度 strlen($abc);//替换字符串中的字符 strtr($abc,'-','-');//拆分字符串 explode("-",$abc);//编码字符串 urlencode($abc);//格式化日期 date('Y-m-d',strtotime($abc));//判断当前日期和指定日期相差几天 (strtotime($today)-strtotime($gd))/3600/24;//UTF-8编码下全角符号替换成半角$tags = "0123ABCDFWS\",.?<>{}[]*&^%#@! 阅读全文
posted @ 2012-09-05 20:00 Younger 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1.丢弃小数部分,保留整数部分php: intval(7/2)js:parseInt(7/2)2.向上取整,有小数就整数部分加1php: ceil(7/2)js: Math.ceil(7/2)3,四舍五入.php: round(7/2)js: Math.round(7/2)4,向下取整php: floor(7/2)js: Math.floor(7/2) 阅读全文
posted @ 2012-04-24 17:45 Younger 阅读(664) 评论(0) 推荐(0) 编辑
摘要: (function() { //创建补0函数 function p(s) { return s < 10 ? '0' + s: s; } //创建、格式化时间函数 var younger_time = function(time) { var time = new Date(time); var year = time.getFullYear(); var month = time.getMonth() + 1; var day = time.getDate(); //格式化时间 var str = year + '-' + p(month) + ' 阅读全文
posted @ 2011-07-28 13:55 Younger 阅读(25382) 评论(1) 推荐(2) 编辑
摘要: <input type="text" id="eeee"><input type="button" value="点击我看看" onclick="ckChinese(document.getElementById('eeee').value)"> function ckChinese(str){ var reg=/[^\x00-\xff]/g; if (reg.test(str)==true){ alert("含有汉字"); }else 阅读全文
posted @ 2011-02-23 19:07 Younger 阅读(1575) 评论(0) 推荐(0) 编辑
摘要: 示例 阅读全文
posted @ 2011-01-14 19:00 Younger 阅读(241) 评论(0) 推荐(0) 编辑
摘要: [代码]代码 阅读全文
posted @ 2010-12-29 11:53 Younger 阅读(565) 评论(0) 推荐(0) 编辑
摘要: 为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的Css属性。比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:代码JavaScript CSS Style属性对照表盒子标签和属性对照CSS语法 (不区分大小写)JavaScript语法 (区分大小写)borderborderborder-bottomborderBottomborder-bottom-colorborderBottomColorborder-bottom-styleborderBottomStyleborder-bottom-widthborderBottomWidthborder-col 阅读全文
posted @ 2010-12-29 11:50 Younger 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 1、直接document.write[代码]2、动态改变已有script的src属性[代码]3、动态创建script元素代码这三种方法都是异步执行的,也就是说,在加载这些脚本的同时,主页面的脚本继续运行,如果用以上的方法,那下面的代码将得不到预期的效果。要动态加载的JS脚本:a.js,以下是该文件的内容。上述代码执行后 a.js 的 alert 执行并弹出消息,但是 主页面产生了错误,没有弹出对话框。原因是 ’str’ 未定义,为什么呢?因为主页面在取 str 的时候 a.js 并没有完全加载成功。遇到需要同步执行脚本的时候,可以用下面的第四种方法。[代码]主页面代码:代码4、原理:用XMLH 阅读全文
posted @ 2010-12-29 11:48 Younger 阅读(927) 评论(0) 推荐(0) 编辑
摘要: 代码写法二:代码 阅读全文
posted @ 2010-12-29 11:41 Younger 阅读(221) 评论(0) 推荐(0) 编辑
摘要: HTML代码如下: 阅读全文
posted @ 2010-12-09 16:39 Younger 阅读(5597) 评论(0) 推荐(0) 编辑