I'm new to the world of javascript. I'm used to strictly typed languages, however I'm trying to get into javascript and jquery. Imagine I have a large set of scripts or functions and I want to avoid the use of anonymous classes. Is there an elegant way to enforce that parameter 'e' needs to be a 'div' object or some JQuery version of that?
var CORE = {
onReady: function(){
$("#generate").click(ELEM.genClick($("#quote")))
},
//...
};
var ELEM = {
genClick: function(e){
// e must be div!
},
//...
};
$(document).ready(CORE.onReady());