how to install pkg on ubuntu | autotweet.php | sitexml dynamic | new id on fb make | api facebook post


Call javascript Function Using Variable for its Name

What is the javascript equivalent of PHP call-user-func?

To call a user-defined javascript function, for example DoReload(), you have just to write its name:


In case you want to call this function using a variable holding its name, for example

var function_to_call = 'DoReload';

just write:


Hope to find it helpful. Your comments are welcomed!

Sign-up for our free email newsletter. Get updates when new tutorials and tips are published. You can unsubscribe anytime with a click.

Your comments are welcomed!

This site actively encourages commenting on any post. Comments are not pre-moderated, but this community does not tolerate direct or indirect attacks, name-calling or insults. Please, read terms of use and Comment Policy at privacy policy.

More tips