The approach that I use currently is to have my javascript functions in separate module files using a module pattern (see post from @Kleo) and then call those functions from a simpler jQuery file. This allows me to re-use the javascripts in other projects ... for example (this is made up):
// module file
var myCar = (function () {
var configs = {
"colour" : "red",
"cost" : 10000,
};
function _applyPaint() {
// private, not exposed
...
}
function start() {
...
}
function stop () {
...
}
function accelerae () {
...
}
var publicFunctions {
start : start,
stop : stop,
accelerate : accelerate,
}
return PublicFunctions;
})();
// jQuery file
$(document).ready( function() {
$("#start").click (function (e) {
e.preventDefault();
myCar.start();
})
$(".stop").click (function (e) {
e.preventDefault();
myCar.stop();
})
});