摘要: [html] Temperature Swap[/html]将函数用作函数的参数,或将函数作为值返回,这些概念属于高阶函数的领域。这个例子解决了一个常见问题:如何将更改中的行为附加到用户接口事件?通过高阶函数,这很容易做到。temperature 高阶函数返回 current 的值,而 current 又可以有 hot 或 cold 函数。看一下这个有些陈旧的函数调用:temp... 阅读全文
posted @ 2010-09-05 23:24 7hihi 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 其实我一直不喜欢一些技术术语,原因是它们有时候对于初学者很匪夷所思.不过很多专业术语已经成形,也被大多数人所接受,我们只能委屈求全.下面来看看javascrapt函数式编程的一术花样名词,看看它们长什么样,有什么作用.1:匿名函数在函数式编程语言中,函数是可以没有名字的,匿名函数通常表示:“可以完成某件事的一块代码”。这种表达在很多场合是有用的,因为我们有时需要用函数完成某件事,但是这个函数可能只... 阅读全文
posted @ 2010-09-05 22:39 7hihi 阅读(178) 评论(0) 推荐(0) 编辑
摘要: [javascript]var a = 11111;var b = { bb: "test"}function fn(a,b){ a = 2222; b.bb= "textbox";//b === window.b console.info(a,window.a);//a !=window.a}fn(a,b);console.log(a); // 11111consol... 阅读全文
posted @ 2010-09-01 16:06 7hihi 阅读(104) 评论(0) 推荐(0) 编辑
摘要: [html] div.tmiddle div.colorbox[/html][css].colorbox{ width:100px; height:100px; border:1px solid #2A6FA8; background-color:#6FA5D1; position:absolute; top:50%; left:50%; margin-left:-50px; margin-t... 阅读全文
posted @ 2010-09-01 14:52 7hihi 阅读(163) 评论(0) 推荐(0) 编辑
摘要: [html]var bFound = true; var bFlag = false; 如上面的两行代码,boolean类型是JavaScript中的一种原始类型,它只有两种值:true和false。使用Boolean(value)方法可以强制转换任意值为boolean类型 alert(Boolean('')); //outpt false alert(Boolean('hel... 阅读全文
posted @ 2010-09-01 13:48 7hihi 阅读(276) 评论(0) 推荐(0) 编辑
摘要: JavaScript中isNaN函数JavaScript中isNaN函数方法是返回一个 Boolean 值,指明提供的值是否是保留值 NaN 。使用方法:isNaN(numValue)其中必选项 numvalue 参数为要检查是否为 NAN 的值。如果值是 NaN, 那么 isNaN 函数返回 true ,否则返回 false 。 使用这个函数的典型情况是检查 parseInt 和 parseFl... 阅读全文
posted @ 2010-09-01 10:52 7hihi 阅读(159) 评论(0) 推荐(0) 编辑
摘要: [html] textbox header let me try 鼠标放上来拖啊,让我们大家一起拖啊拖啊拖 let me try textboxlet me try footer [/html][javascript]YUI({combine: true}).use('dd-drop', 'dd-drag', 'dd-proxy', function (Y) { v... 阅读全文
posted @ 2010-08-31 19:41 7hihi 阅读(170) 评论(0) 推荐(0) 编辑
摘要: [javascript]Object.prototype.clone = function () { if (typeof(this) != 'object') return this; if (this == null) return this; var o = Object.prototype.toString.call(this) === '[object Array]' ... 阅读全文
posted @ 2010-08-25 13:19 7hihi 阅读(115) 评论(0) 推荐(0) 编辑
摘要: [javascript]假设要获取sdfdsdfsd 的 P的outerHTML代码:var _p = document.getElementById('outerID');_P = _P.cloneNode();var _DIV = document.createElement();_DIV.appendChild(_P);alert(_DIV.innerHTML); 就是P的outerHTML... 阅读全文
posted @ 2010-08-24 08:17 7hihi 阅读(124) 评论(0) 推荐(0) 编辑
摘要: [html]演示地址:http://7hihi.com/millet/1.0.5/m.html[/html][javascript]/* * Millet JavaScript Library v1.0.5 * http://7hihi.com * * Copyright 2010, textbox * Dual licensed under the MIT or GPL Version 2 li... 阅读全文
posted @ 2010-08-23 21:03 7hihi 阅读(157) 评论(0) 推荐(0) 编辑