Yes, that's why I messed around with javascript for a while, but only recently got into things like object orientation, prototyping and using objects for all functions and vars.
But many frameworks, such as jQuery or extJS, have something that I still have to understand, you can define an object using the built-in function to search for dom, for example:
var a = $('#mydiv');
and then you can do a.click (function);
So my question is: how can I create a "framework" where I can write code in this style, for example:
var mydiv = document.querySelector('mydiv'); mydiv.neph(args,args);
So, I defined my object, in this case it is a dom element or something else, now I pass it to the "neph" function with arguments, I want to create code that allows me to do this. But since mydiv does not have any function, it only has a dom element in this case, so mydiv.neph does not exist, but in jquery you can define any var and .click or .mouseover variables or something else existing in the object as function? There is confusion !: D
Ok, sorry if this is a late question btw = P
source share