2015年1月7日

angular js及时获取数据值

摘要: var directiveData = app.directive("directiveP2", function () { return { link:function postLink(scope,lEle,lAttr) { ... 阅读全文

posted @ 2015-01-07 21:11 wuye1200 阅读(238) 评论(0) 推荐(0) 编辑

2014年6月24日

smarty

摘要: //载入核心文件include "./libs/Smarty.class.php";$smarty = new Smarty();//模版目录$smarty->template_dir = "template";//模版目录$smarty->compile_dir = "temp/compile";... 阅读全文

posted @ 2014-06-24 15:44 wuye1200 阅读(145) 评论(0) 推荐(0) 编辑

2014年4月20日

php常用变量

摘要: unset 销毁指定的变量array_unshift 在数组开头插入一个或多个单元var_export 输出或返回一个变量的字符串表示file_put_contents 将一个字符串写入文件rtrimstr_replace 阅读全文

posted @ 2014-04-20 13:07 wuye1200 阅读(153) 评论(0) 推荐(0) 编辑

2011年10月23日

JS json object 与 string 相互转换

摘要: object转stirngfunctionobj2str(o){varr=[];if(typeofo=="string"||o==null){returno;}if(typeofo=="object"){if(!o.sort){r[0]="{"for(variino){r[r.length]=i;r[r.length]=":";r[r.length]=obj2str(o[i]);r[r.length]=",";}r[r.length-1]="}"}else{r[0]=&quo 阅读全文

posted @ 2011-10-23 00:20 wuye1200 阅读(245) 评论(0) 推荐(0) 编辑

2011年8月8日

JavaScript 无阻塞加载脚本与异步脚本整合

摘要: <scripttype="text/javascript"><!--$_E={//单个脚本加载使用的接口,不理有序和无序loadScript:function(url,onload){$_E.loadScriptDomElement(url,onload);},//多个脚本下载使用的接口,有序,并且区分域loadScripts:function(urls,onload){varE=$_E;varlen=urls.length;varbDifferent=false;//判断是否脚本处于不同域的标志//判断是否加载的脚本不同域for(vari=0;i< 阅读全文

posted @ 2011-08-08 15:09 wuye1200 阅读(351) 评论(0) 推荐(0) 编辑

2011年7月14日

设置iframe高度 自适应

摘要: functionSetCwinHeight(){//alert(1);variframeid=document.getElementById("iframe1");//iframeidif(document.getElementById){if(iframeid&&!window.opera){if(iframeid.contentDocument&&iframeid.contentDocument.body.offsetHeight){iframeid.height=iframeid.contentDocument.body.offsetH 阅读全文

posted @ 2011-07-14 16:49 wuye1200 阅读(160) 评论(0) 推荐(0) 编辑

2011年6月16日

iframe高度自适应

摘要: varadjustIframe=function(id){variframe=document.getElementById(id)varidoc=iframe.contentWindow&&iframe.contentWindow.document||iframe.contentDocument;varcallback=function(){variheight=Math.max(idoc.body.scrollHeight,idoc.documentElement.scrollHeight);//取得其高iframe.style.height=iheight+"p 阅读全文

posted @ 2011-06-16 09:54 wuye1200 阅读(167) 评论(0) 推荐(0) 编辑

2011年6月14日

数组去重记录下

摘要: Array.prototype.distinct=function(){varret=[];for(i=0,ii=this.length;i<1*ii;i++){for(j=i+1;j<1*this.length;){if(this[i]===this[j]){ret.push(this.splice(j,1)[0]);}else{j++;}}}this.ret=ret;returnthis;}//测试alert(['a','b','c','c','d','b','a', 阅读全文

posted @ 2011-06-14 12:30 wuye1200 阅读(173) 评论(0) 推荐(0) 编辑

微博插入话题

摘要: 效果的实现文字的选中功能是不太常用的功能,多出现在文本编辑器中,或是文本域之类的光标处理上。所以呢,使用的一些属性也并不是常见的。在IE浏览器下使用的是createTextRange而Firefox/chrome等现代浏览器下使用的是setSelectionRange。假设文本域对象的名称是obj,则在IE及非IE浏览器下实现指定文字选中的代码如下:IE浏览器下: var range = obj.createTextRange();range.moveStart("character", 开始序号);range.moveEnd("character", 阅读全文

posted @ 2011-06-14 09:59 wuye1200 阅读(250) 评论(0) 推荐(0) 编辑

2011年6月2日

封装常用代码

摘要: getElementsByClassName附上一片关于getElementsByClassName的文章一篇 http://hszy00232.blog.163.com/blog/static/43022753201042051443548/functiongetElementsByClassName(oElem,strTagName,strClassName){vararrElements=(strTagName=='*'&&oElem.all)?oElem.all:oElem.getElementsByTagName(strTagName);varretu 阅读全文

posted @ 2011-06-02 11:59 wuye1200 阅读(265) 评论(0) 推荐(0) 编辑

导航