摘要: 1. jQuery 的执行时间:$(document).ready(function(){ --- jQuery functions go here ---- // 保证当文档对象加载完成后,进行元素事件处理函数的绑定});jQuery 是基于事件相应机制进行处理的,为给定元素的事件绑定事件处理函数,当事件发生时,触发相关的函数。2. 常用 函数 a.元素效果(隐藏和显示) //语法:$(selector).hide(speed,callback); //隐藏元素;speed :"slow"、"fast" 或毫秒 ms 数值, callback:回调函数 阅读全文
posted @ 2014-02-09 23:56 Luan Louis 阅读(163) 评论(0) 推荐(0)
摘要: 话题引入: 对象的创建和生成 在我们需要创建一个对象时,可以通过各种方式。 最直接的方式莫过于new 了。另外也可以通过Class对象的newInstance(),以及 Constructor.newInstance(Class ... args);进行创建。 1 public class ClassName{ 2 // The defintions of this class goes there. 3 } 4 5 // 通过new 创建 6 ClassName instance = new ClassName(); 7 8 9 // 通过newInstance创建10 C... 阅读全文
posted @ 2014-02-09 23:52 Luan Louis 阅读(253) 评论(0) 推荐(0)
摘要: 装饰者模式在设计的时候,往往要给一个对象的功能进行一些修饰,对功能进行拓展和增强,以满足我们的需求。举个例子,最近流行歌曲比赛,什么《中国好声音》,《中国好歌曲》什么的,对于一个参赛者而言,就是唱歌,定义类如下:public class Competitor { public void sing() { System.out.pri... 阅读全文
posted @ 2014-02-09 23:46 Luan Louis 阅读(215) 评论(0) 推荐(0)
摘要: 一、JavaScript的一些语言特性 1.当我们声明一个函数时,实际上是定义了一个函数类型的对象。如下所示,下面三种方式定义函数对象结果是一样的。 var func = function(){ //....define code goes there.}function func (){ // ...define code goes there.}var fun... 阅读全文
posted @ 2013-11-17 23:58 Luan Louis 阅读(254) 评论(0) 推荐(0)
摘要: dojo 对Javascript1.6 的数组操作功能进行了拓展:clearCache()every(arr, callback, thisObject) Determines whether or not every item in arr satisfies the condition implemented by callback.filter(arr, callback, thisObject) Returns a new Array with those items from arr that match the condition implemented by callback.f 阅读全文
posted @ 2013-11-03 00:46 Luan Louis 阅读(235) 评论(0) 推荐(0)
摘要: 1. dojo 的模块化 dojo 的模块化是指,dojo将每个冗杂的js代码有组织的分割开,划分为模块,需要该模块时,将其引入,即可使用,这个类似于在java代码里的 import 语句; 比如我们需要dojo.a.b 模块,只需要执行下面的语句:require("dojo.a.b"); // 实际上这个是相当于加载dojo/a/b.js 文件2、dojo.hitch() 此方法为指定的函数绑定上下文,并执行。function printAge(){ console.log(age);}var girl = { age:20}var woman = { ag... 阅读全文
posted @ 2013-11-02 23:19 Luan Louis 阅读(359) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-11-02 21:52 Luan Louis 阅读(101) 评论(0) 推荐(0)
摘要: AttributeUsageexplainationexamplearguments[function.]arguments[[0|1|2|...|n]]当前正在运行的函数的参数func.arguments[0],对参数0 的引用arguments.callee[function.]arguments.callee当前在正在执行的函数引用,可用于函数的递归。该属性仅当相关函数正在执行时才可用。function factorial(n){ if (n ");var y = new MyObj;if (y.constructor == MyObj) document.write(&quo 阅读全文
posted @ 2013-11-02 15:37 Luan Louis 阅读(265) 评论(0) 推荐(0)