Call a javascript function from another file
The issue you have is that Slider is not accessible outside of its scope as that’s defined by the .ready() though you’ve used shorthand for that. The function needs to be available in the global scope: file1.js function Slider() { this.nb_ele = 10; } jQuery(function($) { // … }); file2.js jQuery(function($) { var slider = … Read more