检查Prototype是否已加载

mco*_*ont 1 javascript prototype

如何检查原型是否已加载/包含在页面中?如果我检查"Prototype"对象并且未加载原型,则在firebug中出现"Prototype is not defined"错误.

http://jsfiddle.net/pampurio97/evRTx/

0x4*_*2D2 7

使用typeof将传递未声明/未定义的对象.

if ( typeof Prototype !== "undefined" ) {
    // ...
}
Run Code Online (Sandbox Code Playgroud)