简体   繁体   中英

Ladda is not defined with node.js

I have two ladda buttons on two different pages rendered by node.js along with bootstrap components in my application.

I have the Ladda installed using bower install ladda .

home.jade

button.btn.btn-primary.makeSearch.ladda-button(data-style='expand-left')
span.ladda-label home

login.jade

button.btn.btn-primary.btn-block.ladda-button(data-style='expand-left')
span.ladda-label Login

common.js

var l = Ladda.create(this);
l.start();

However, I get

Uncaught ReferenceError: Ladda is not defined

But the spinner works fine without any error for one button in one first page, whereas I get an not defined error for the other button.

I guess your are missing ladda.min.js and spin.min.js files!

Please read Instructions carefully.

The compiled files for the project that you should be using are available in the /dist directory. You will need to include both the ladda.min.js and spin.min.js files as well as ONE of the two style sheets. If you want the button styles used in the Ladda example page use the ladda.min.css file, if you want to have the functional buttons without the visual style (colors, padding etc) use the ladda-themeless.min.css file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM