我想知道是否有办法确定变量是否包含 MooTools 类实例。
下面是 jsFiddle 中的示例:http: //jsfiddle.net/kGnaa/
var a = new Class();
var aInstance = new a();
document.write('#1 instanceOf(aInstance,a) = ' + instanceOf(aInstance,a) + '<br>') // aInstance is instance of a. Returns true.
document.write('#2 instanceOf(aInstance,Class) = ' + instanceOf(aInstance,Class) + '<br>') // aInstance isn't instance of Class, so returns false.
有没有办法让#2发生?