03.js

来自「进行ajax开发sdsd s d sd s」· JavaScript 代码 · 共 28 行

JS
28
字号
/** * com/davidflanagan/Shapes.js: a module of classes representing shapes * * This module defines classes within the com.davidflanagan.shapes namespace * This module requires the com/davidflanagan/Class.js module **/// First, check for the Class modulevar com;  // Declare global symbol before testing for its presenceif (!com || !com.davidflanagan || !com.davidflanagan.Class)    throw new Error("com/davidflanagan/Class.js has not been loaded");// Import a symbol from that modulevar define = com.davidflanagan.Class.define;// We know from the test for the Class module that the com.davidflanagan// namespace exists, so we don't have to create it here.  // We just create our shapes namespace within it.if (com.davidflanagan.shapes)    throw new Error("com.davidflanagan.shapes namespace already exists");// Create the namespacecom.davidflanagan.shapes = {};// Now define classes storing their constructor functions in our namespacecom.davidflanagan.shapes.Circle = define({ /* class data here */ });com.davidflanagan.shapes.Rectangle = define({ /* class data here */ });com.davidflanagan.shapes.Triangle = define({ /* class data here */});

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?