OZONE Asylum
Forums
DHTML/Javascript
Running a function by name?
This page's ID:
27758
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
How you wrote your [i]f1()[/i] function implies that you pass the handle of a function, hence you should do:[code]f1( f2 );[/code]But for what you want, your [i]f1()[/i] function should look like:[code]function f1( functionName ) { var theFunction=window[functionName]; if( typeof(theFunction)=='function') return theFunction(); // fallback return null; }[/code]Hope that helps, [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img][/sigrotate][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »