javascript - Laravel mix how to require a jquery library (parsely js) -


i have problem using parsley js (jquery plugin validation) in js file can require wouldn't work $(...).parsley not function , use laravel mix , use sweet alert , works properly, tried change parsley.js :

module.exports = parsley; 

instead of

 return parsley; 

but still have same problem: $(...).parsley not function here code require , try use parsley:

var parsley = require('../libs/parsleyjs/parsley.js'); $('[registerform]').parsley().validate(); 

please , thank you

thank @apokryfos , solved problem, solution install parsley via npm , require :

var parsley = require('parsleyjs')

from package.json instead of

var parsley = require('../libs/parsleyjs/parsley.js');


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -