External javascript function gives undifined error

4
I'm trying to use an external javascript library to get a nice slider working in my application. The js file of this plugin is loaded in the index.html and i'm trying to access on of the functions using an HTML snippet. But when i call the function it gives an error saying Uncaught TypeError: $(...).slick is not a function Is there a way to use an external javascript library without creating a widget.
asked
2 answers
4

It seems to me that you need to have the jQuery library loaded in the index.html before you load the javascript library. My guess is that it will work after that.

answered
4

Seems like a timing problem because of asynchronous loading. You can build a custom widget using the Mendix Widget Boilerplate and require the library, or wait for the library to be loaded using the mendix.lang.delay function.

answered