Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / May 2007



Tip: Looking for answers? Try searching our database.

Returning a property from a function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas K. Nielsen - 31 May 2007 11:16 GMT
Hi I have the following structure of namespaces

aa = {};
aa.bb = {};
aa.bb.aaList = function(int){};
aa.bb.aaList.prototype = {
 aQuestion: function(id){
                   active = this.anArray[id] // settin the value of
active from an array I have built earlier
}
};

//----------------------------------------------------

Now I want to call my function

x = new aa.bb.aaList(50);
//x.aQuestion(10) // I can do this - but I want a way to return the
active property of the aQuestion function
like this :
x.aQuestion(10).active

How can I do that? Any suggestion? Thanks in advance
Thomas
scripts.contact - 31 May 2007 12:43 GMT
> x = new aa.bb.aaList(50);
> //x.aQuestion(10) // I can do this - but I want a way to return the
[quoted text clipped - 3 lines]
>
> How can I do that? Any suggestion? Thanks in advance

in your function,return an object with active property :
return {active: whatever }
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.