The Cellar  

Go Back   The Cellar > Main > The Internet
FAQ Community Calendar Today's Posts Search

The Internet Web sites, web development, email, chat, bandwidth, the net and society

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-13-2005, 10:31 AM   #1
jaguar
whig
 
Join Date: Apr 2001
Posts: 5,075
Javascript functions...

Here we go again...

I'm playing around with something at the moment, I'm trying to find a way to be able to call pass a function as a paramater to another function, for example:


Code:
var obj = new Object();

obj.test = function() {
alert("working!");
}

obj.run(param) {
param;  //execute param, in theory.
}
so that when you call:
obj.run(obj.test);
obj.test gets executed. Obviously it doesn't work. A bit of playing around had led me to believe it is simply putting the code of the function there instead of running it, whether it's a named function of an anonymous function attached to an object. Anyone got any ideas?
__________________
Good friends, good books and a sleepy conscience: this is the ideal life.
- Twain
jaguar is offline   Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

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

Forum Jump

All times are GMT -5. The time now is 08:37 AM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.