Jose Osorio Jose Osorio - 1 year ago 74
HTML Question

MeteorJS external files: css and js

I am trying to add this bootstrap theme to my project this theme have 4 js files beside jquery and bootstrap.

I added jquery and bootstrap to my project, This 4 files are in the compatibility folder, as Metereor doc said, but It did not work. The navbar effect when scroll down the page is not working and I sometimes(If I leave the .js files name untouched) got an error about fitText.js file.

PD1: Compatibility folder loads the .js files in alphabetical order.

PD2: I tried a lot of suggestions that I found, here in stack and meteor forums but nothing happen.

I put css and less files in client/lib/stylesheet and they seens to be ok.

What can I do to make this theme to work in meteor.?


JS Files

  • 1.jquery.easing.min.js

  • 2.jquery.fittext.js


  • 4.creative.js

I place them with creative theme load order

Answer Source

I found a solution that works perfect. I hope it could help other people, I use jquery and .rendered to load the scrips after the page is fully rendered and all the effects I wanted to use where available

Template.layout.rendered = function() {

  $('head').append('<script type="text/javascript" src="/javascript/jquery.easing.min.js"></script>');
  $('head').append('<script type="text/javascript" src="/javascript/jquery.fittext.js"></script>');
  $('head').append('<script type="text/javascript" src="/javascript/wow.min.js"></script>');
  $('head').append('<script type="text/javascript" src="/javascript/creative.js"></script>');

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download