secrets of the javascript Ninja(Function Type)(javascript忍者的秘密)
来源:互联网 发布:java遍历list map 编辑:程序博客网 时间:2024/05/16 16:46
大多数情况下,typeof就可以完成检查函数类型的工作,例如:
但是根据浏览器的不同,我们可以发现以下集中情况
- 在firefox2和firefox3中,如果检测一个<object/>类型的元素,将会检测出来是一个function
- firefox2正则表达式会被认为是一个function;但是在firefox3中会被认为是object
- IE6和IE7中一些dom元素的方法会被认为一个object //typeof /test/=='function'
- safari3中认为NodeList为function如:typeof document.body.childNodes =="function"
纵观以上所有情况,我们可以写出一个通用的函数来检测某个值是否是函数
- secrets of the javascript Ninja(Function Type)(javascript忍者的秘密)
- secrets of the javascript Ninja (Function Prototypes)(javascript忍者的秘密)
- secrets of the javascript Ninja( javascript Timer)(javascript忍者的秘密)
- secrets of the javascript Ninja( with(){} 的用法)(javascript忍者的秘密)
- 翻译 Secrets of the JavaScript Ninja - 1.进入忍者的世界(1.Enter the ninja)
- 翻译 Secrets of the JavaScript Ninja (JavaScript忍者禁术)
- 翻译 Secrets of the JavaScript Ninja - 2.测试和debug(2.Testing and debugging)
- 翻译 Secrets of the JavaScript Ninja - 3.函数是根基(3.Functions are fundamental)
- 翻译 Secrets of the JavaScript Ninja - 4.挥舞函数(4.Wielding functions)
- 翻译 Secrets of the JavaScript Ninja - 5.闭包 (5.Closing in on closures)
- 翻译 Secrets of the JavaScript Ninja - 6.原型与面向对象(6.Object-orientation with prototypes)
- Secret of the JavaScript Ninja 学习笔记 - 1
- Secret of the JavaScript Ninja 学习笔记 - 2
- Secret of the JavaScript Ninja 学习笔记 - 3
- Secret of the JavaScript Ninja 学习笔记 - 4
- Secret of the JavaScript Ninja 学习笔记 - 5
- Secret of the JavaScript Ninja 学习笔记 - 6
- Secret of the JavaScript Ninja 学习笔记 - 7
- 调试Bug的神兵利器:通过WinDbg条件断点收集Log
- msql中的limit查询
- httpwatch~
- oracle中创建序列和自增长列的实现方式
- 也談 在 Toolbar 中插入 ComboBox
- secrets of the javascript Ninja(Function Type)(javascript忍者的秘密)
- Microwindows 介绍
- Struts 弱点
- SUN公司SCJP认证学习之旅
- 忙活了两天,Introduction部分总算翻译完了。
- 2009-03-30技术学习:wicket控件PasswordTextField使用
- Application.CreateDesignFile
- 3月30号漏洞挖掘
- Log my life