HighDots Forums  

Re: Getting a reference to the currently executing function object

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Getting a reference to the currently executing function object in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mick white
 
Posts: n/a

Default Re: Getting a reference to the currently executing function object - 12-04-2006 , 03:31 PM






David Golightly wrote:

[snip]
Quote:
function Funk() { this.params = {}; }

Funk.prototype.setParam = function(key, value) {
this.params[param] = value;
}

Close...

Funk.prototype.setParam = function(key, value) {
this.params[key] = value;
}

Mick

Quote:
var f = new Funk;
f.setParam('monkeys', 23);
f.setParam('fruit', 'grapes');
for (var p in f.params) { alert(p + ':' + f.params[p]); }


Reply With Quote
  #2  
Old   
David Golightly
 
Posts: n/a

Default Re: Getting a reference to the currently executing function object - 12-04-2006 , 03:33 PM







mick white wrote:
Quote:
David Golightly wrote:

[snip]
function Funk() { this.params = {}; }

Funk.prototype.setParam = function(key, value) {
this.params[param] = value;
}


Close...

Funk.prototype.setParam = function(key, value) {
this.params[key] = value;
}

Mick

var f = new Funk;
f.setParam('monkeys', 23);
f.setParam('fruit', 'grapes');
for (var p in f.params) { alert(p + ':' + f.params[p]); }

Right, that's what I meant Thanks, Mick.

David



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.