[CODE]var cjs = function(){
function RtnObjWant(el){
return (typeof(el) == ‘object’) ? this.Obj = ele : this.Obj = document.getElementById(el);}
return {
RtnObj : function(el) {
return (typeof(el) == ‘object’) ? this.Obj = ele : this.Obj = document.getElementById(el);},
getById : function(el) {
return document.getElementById(el);}
};
}();
cjs.sh = function() {
return {
ShowIt : function(el) {
this.RtnObjWant(el).style.display=”;}, // Doesnt Work
HideIt : function(el) {
cjs.RtnObj(el).style.display=’none’;} // Works but is there a way to access it with using this instead?
};
}();
cjs.css = function() {
etc….
Question is above in the code but ill rephrase here. How can i call another sub-objects function without using the variable name that it was originally created under, like using this.parent or something.
Like if i wanted to call a function under another sub-object like from the sh sub-object to the css sub-object. I tryed with this.parent.css and that didnt work.
The RtnObjWant function is a private function i believe under the main object so i don’t think other sub-objects can touch that function but I know they can hit the other functions that are not private using the variable name, in this case ‘cjs’, but i want a more dynamic way in case i have to change the original variable name to something besides cjs.
Thanks in advance.