i want to create some javascript object with few functions, but i get a exception
undefined is not a function
JS:
var Buses = null;
$(function () {
Buses = function() {
return {
Test: function () {
console.log('test public function');
}
}
}
});
HTMl:
<button onclick="Buses.Test()">test</button>
<script type="text/javascript" src="js/buses.js" ></script>
What is wrong?