incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Coleman <>
Subject requiring javascript for plugins
Date Thu, 05 Jul 2012 23:12:24 GMT
Is there a new recommended way to include javascript for plugins?

Previously I just jammed an object onto navigator or a global variable

    navigator.toast = new Toasty();

I've rewritten this plugin's javascript as a module and I'm
recommending that the user requires the module in their code with

    var toast = cordova.require('toast');

Is this the recommended way?

It works fine, it's just an extra step for the user, and different
from using a builtin cordova function like

Should I still assign the plugin code to navigator or cordova?
Is there a way to have my plugin js required by plugin.xml,
cordova.addPlugin or some other function???
Are users to need to require built-in cordova for 2.0+?

View raw message