function $$(f) { if (typeof f == 'function') {//f是一个函数 f(); } else { alert('not a function'); } } ...
分类:
编程语言 时间:
2014-09-11 13:51:41
阅读次数:
190
// 构造函数模式function Car(name, logo) { // 强制使用new, "this" point to the instance if (!(this instanceof Car)) { return new Car(name, logo); ...
分类:
编程语言 时间:
2014-09-10 15:36:00
阅读次数:
176
1.反射即是获取一个运行程序或其他程序的元数据2.type类是一个抽象类,不能被实例化,用来包含类型的数据Type t = myInstance.GetType();Type t =Typeof(myInstance);3.特性(attribute)特性是一种向程序集增加元数据的语言结构,特性片被方...
分类:
其他好文 时间:
2014-09-10 00:16:39
阅读次数:
257
In 8.1 we use the below code to navigate between pages:this.Frame.Navigate(typeof(PivotPage));In 8.1 we need to use the event to add hardware back eve...
分类:
其他好文 时间:
2014-09-09 22:43:59
阅读次数:
226
String.prototype.format?=?function(args)?{
????var?result?=?this;
????if?(arguments.length?>?0)?{????
????????if?(arguments.length?==?1?&&?typeof?(args)?==?"ob...
分类:
编程语言 时间:
2014-09-09 21:41:29
阅读次数:
342
语法严格模式 启用严格模式,在脚本顶部或函数内部上方添加"use strict";语句.数据类型typeoftypeof返回undifined,boolean,number,string,object,function六种字符串,typeof null会返回"object".数据类型包括六种:und...
分类:
编程语言 时间:
2014-09-09 20:07:39
阅读次数:
205
//JS实现AOP拦截方法调用function jsAOP(obj,handlers) { if(typeof obj == 'function'){ obj = obj.prototype; } for(var methodName in handlers){ var _handlers = ha...
分类:
Web程序 时间:
2014-09-09 17:47:09
阅读次数:
1085
function inArray(needle,array,bool){ if(typeof needle=="string"||typeof needle=="number"){ for(var i in array){ if(needle===a...
分类:
编程语言 时间:
2014-09-09 17:38:39
阅读次数:
221
在js中常见的六种数据类型:String类型、Null类型、Number类型、Boolean类型、Object类型。1、typeof的注意点涉及到数据类型,不免会提到,操作符 typeof。要注意:1、typeof是操作符,不是方法。虽然我们经常使用typeof()的方式获取对象的数据类型。2、对 ...
分类:
编程语言 时间:
2014-09-09 15:49:48
阅读次数:
276
上篇讲到启动Consumer,调用了DefaultCamelContext.startService(service)方法,下面是方法源码:
private void startService(Service service) throws Exception {
if (service instanceof StartupListener) {
StartupListener liste...
分类:
其他好文 时间:
2014-09-07 17:20:15
阅读次数:
209