Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2007, 09:18 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic function

Hi,

I have this function that triggers a timer... but when the timer is done I want it to trigger different functions depending on the arguments created... So say that when the timer is first initialized, I store the name of the function that I want to be executed in a variable... now when the timer is done, I want it to execute that function...

So were I to use the new function argument... how do I actually trigger the thing? Or does someone have a better suggestion?

Thank you,

 
Old April 2nd, 2007, 10:27 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Your question is too vague without any example code but to call a function based on its name you can use:
Code:
window["myFunction"]();
or if you are using setTimeout:
Code:
setTimeout("myFunction", 1000);
--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Columns & Dynamic Grouping ??? nileshgambhava BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 1 March 24th, 2008 07:58 AM
help writing dynamic form data to dynamic table ublend SQL Server ASP 1 June 1st, 2007 08:09 AM
help writing dynamic form data to dynamic table ublend Classic ASP Professional 1 June 1st, 2007 08:08 AM
Dynamic Checkboxes using dynamic Select Values bsheridan Classic ASP Databases 0 March 12th, 2006 10:17 AM
dynamic charting function with c# and asp.net 102504502 ASP.NET 2.0 Professional 0 February 22nd, 2006 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.