Add third party plugin without calling on init


Hey guys,
I’m trying to add this plugin to my meteor project:

I’ve put it into my client/plugins folder and now having the following problem: The function gets executed on start and throws an error (element “body” wasn’t found - it’s logical, because the pages isn’t rendered at execution).

How can I add this plugin correctly to my Meteor project?


Try removing init() and call it yourself


Hey okay,
I’ve added it to a variable and calling it after rendering the template.

But what about jQuery plugins that are not listed on Atmosphere (f.e. I’ve only found some difficult solutions to add them manually but is there an easy solution to add them?

At this moment, I would add them the following way:


 initFace = function() {  ...jquery plugin code ... };


Template.layout.onRendered(function() { initFace(); } );

But is that a “good” solution?


I’d say yes, but I’m not an advanced programmer. You’ve made this modular, I think.