上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页
摘要: 先看下以下数字:google 以下关键字结果:js 事件模型 as3 事件模型 :找到约 168,000 条结果 JAVA事件模型:C++ event model 在搜索下PHP的事件模型,相差甚远看完上面的数据后,你可能会想,事件机制在PHP真的不那么重要,对于这个重要的问题,或许通过下面的问题你可以直接得出个结论假设 A B 在同时开发一个项目(或者更多人在同时开发)根据MVC架构,先开始写的该是M,A在写一个MODEL,而B在写另一个MODEL经常会有一个问题,就是MODEL之间的相关性,当A写的MODEL有一个操作,这个操作会影响到B的MODEL第一个反应,就是在A写的MODEL调用B 阅读全文
posted @ 2011-04-20 09:32 liushan 阅读(741) 评论(3) 推荐(0) 编辑
摘要: 于上一个版本的区别,把事件处理简化:<?phpclassEventextendsstdClass{public$target=null;public$type=null;/***创建事件*@paramstring$type*/publicfunction__construct($type){$this->type=trim($type);}/***得到事件字符串*/publicfunction__toString(){return$this->type;}}abstractclassEventDispatcher{private$_callback_method;/***添加 阅读全文
posted @ 2011-03-22 16:10 liushan 阅读(739) 评论(0) 推荐(0) 编辑
摘要: start stop 阅读全文
posted @ 2011-03-17 19:46 liushan 阅读(525) 评论(0) 推荐(0) 编辑
摘要: <?php/***取得根域名**@authorlonely*@create2011-3-11*@version0.11*@lastupdatelonely*@packageSl*/classRootDomain{privatestatic$self;private$domain=null;private$host=null;private$state_domain;private$top_domain;/***取得域名分析实例*Enterdescriptionhere...*/publicstaticfunctioninstace(){if(!self::$self)self::$sel 阅读全文
posted @ 2011-03-08 17:56 liushan 阅读(2685) 评论(0) 推荐(1) 编辑
摘要: 后端:<?php$json_str=json_encode(array("ddd"=>"11111111"));echo$_GET['ja'].'('.$json_str.')';?>前端:$.getJSON('http://www.liushan.cn/test.php?ja=?',function(json){alert(json);});纯JS实现(JSONP)://serverreturnaa({'ddd':'ddd'})callba 阅读全文
posted @ 2011-03-07 15:16 liushan 阅读(552) 评论(0) 推荐(0) 编辑
摘要: 当用new创建类的实例时,解释器首先会创建一个空的对象(相当于创建了一个新的作用域),把原型对象指向这个函数的原型对象,将this指针指向创建的上步创建的空对象然后运行这个函数。代码理解为:vara={};functionb(var){ //这里相当于写构造函数this.hi=function(){alert(var);}}//a.__proto__=b.__proto__#只能运行在FIREFOX上b.call(a,"hi");//call apply 用于对象方法a.hi();而Function对象在执行JS代码时候是先执行生产的vara=function(){};a( 阅读全文
posted @ 2011-03-05 21:49 liushan 阅读(1718) 评论(0) 推荐(0) 编辑
摘要: /[\?&]{1}_ajax[&\s]{1}|[\?&]{1}_ajax$/|代表或hidefocus="true" ie虚线问题 (IE67不支持)事件监听的时候通过传入变量来产生局部变量(JAVASCRIPT DOM高级编程 PAGE33),如下解释:var a=1; .click(function(){ alert(a); })a++; a如果不是传入进去的,变量作用域在外面,当上面的东东循环的时候会出问题.var a=1; .click(function(a){ //在包一层来产生临时变量 return function(){ }}(a))a 阅读全文
posted @ 2011-02-24 18:20 liushan 阅读(262) 评论(0) 推荐(0) 编辑
摘要: /***修改JQ的键盘事件,使文本等标签也可以监听键盘事件,兼容:chrome Firefox 3.5 3.6 opera IE 6 7 8 (IE67有虚线)*@param{Object}Jquery*@authorLonely*/(function($){varno_ie_pr=function... 阅读全文
posted @ 2011-02-24 14:53 liushan 阅读(991) 评论(0) 推荐(0) 编辑
摘要: View Code /***兼容BackCompat,CSS1Compat两模式渲染的页面,测试的浏览器 :friefox ie678 chrome opera*@authorLonely*/(function($){/***取得浏览器视图的宽度*/$.viewWidth=function(){va... 阅读全文
posted @ 2011-02-22 19:31 liushan 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->functionalertSize(){varmyWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){//Non-IEmyWidth=window.innerWidth;myHeight=window.innerHeight;}elseif(document.documentElement&amp;& 阅读全文
posted @ 2011-02-14 10:54 liushan 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页