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 = new Slider();
}); 

If you want Slider to stay in the document ready, you’ll need to use a function expression to add the function to the global object:

jQuery(function($) {
    window.Slider= function () {
       this.nb_ele = 10;
    };
});

See Also: https://stackoverflow.com/questions/1449435/splitting-up-jquery-functions-across-files