A.
//定义 cordova.define( "cn.edu.chzu.mmwd.helloplugin.helloPlugin" , function (require, exports, module) { var HelloPlugin = function () {}; HelloPlugin.prototype.say= function () { alert( "EN: HelloWorld! \nThis is aJavaScript-Only Plugin!" ); }; var helloPlugin = new HelloPlugin(); }); //使用 HelloPlugin.say();
B.
//定义 cordova.define( "cn.edu.chzu.mmwd.helloplugin.helloPlugin" , function (require, exports, module) { var HelloPlugin = function () {}; HelloPlugin.prototype.say= function () { alert( "EN: HelloWorld! \nThis is aJavaScript-Only Plugin!" ); }; var helloPlugin = new HelloPlugin(); module.exports= helloPlugin; }); //使用 HelloPlugin.say();
C.
//定义 cordova.define( "cn.edu.chzu.mmwd.helloplugin.helloPlugin" , function (require, exports, module) { var HelloPlugin = function () {}; HelloPlugin.say= function () { alert( "EN: HelloWorld! \nThis is aJavaScript-Only Plugin!" ); }; var helloPlugin = new HelloPlugin(); module.exports= helloPlugin; }); //使用 HelloPlugin.say();
D.
//定义 function ( "cn.edu.chzu.mmwd.helloplugin.helloPlugin" , function (require, exports, module) { var HelloPlugin = function () {}; HelloPlugin.prototype.say= function () { alert( "EN: HelloWorld! \nThis is aJavaScript-Only Plugin!" ); }; var helloPlugin = new HelloPlugin(); module.exports= helloPlugin; }); //使用 HelloPlugin.say();