473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Accessing an objects parent class

See the below objects:

function Manager()
{
this.reports=new Reports();
}

function Reports()
{
//How do I access Manager from here?
}

Jul 1 '07 #1
1 1450
On Jul 1, 9:57 am, "egg...@gmail.com" <egg...@gmail.comwrote:
See the below objects:

function Manager()
{
this.reports=new Reports();
}

function Reports()
{
//How do I access Manager from here?
}
You can get the function that called a function using:

arguments.callee.caller;

so

function Reports() {
//How do I access Manager from here?
var caller = arguments.callee.caller;
}

does the job in those browsers that support it (Firefox and Safari at
least, I don't think IE does) - but I can't see how that's useful.

It is usually better to explain what you are trying to do at a higher
level, then maybe someone will tell you how to do it, rather than
asking for how to do something explicit that has no obvious rationale.
--
Rob

Jul 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bryan Martin | last post by:
I have a object that is created in a seperate domain which needs to be passed back to the parent class. Because this object is created in a seperate domain if I try to pass the object back to the...
5
by: Suzanne Vogel | last post by:
Hi, Given: I have a class with protected or private data members, some of them without accessor methods. It's someone else's class, so I can't change it. (eg, I can't add accessor methods to the...
2
by: Havatcha | last post by:
Does anyone know the syntax for accessing assignment operators in a Parent Class from a Child Class? If so, would be great if you could post a brief example here. Thanks.
8
by: Lüpher Cypher | last post by:
Hi, Suppose we have a hierarchical class structure that looks something like this: Object | +-- Main | +-- Object1
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
0
by: João Rezende | last post by:
Hello, I have two objects implemented with CollectionBase framework, say MyParent and MyChild. MyChild object is embedded into MyParent and I need to bind some MyChild properties via MyParent....
1
by: Xarious | last post by:
Hi all, I need to bring up a form off of my base win form and then, depending on which button the user clicks, perform a function that is in my base form. I can create an instance and show the...
29
by: RageARC | last post by:
I have the following code: index.php: class main_class { public $database = new DAL; public $html = new HTML; }
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.