We help IT Professionals succeed at work.
Get Started

Call function as array

tonelm54 asked
Last Modified: 2014-05-12
Im trying to call a function from an array value, I thought I could assign it by:-
var defaults = {
            'afterClose' : function () { alert("Not Declared"); }

Open in new window

And then call it like:-

Open in new window

However doesnt seem to work. Does anyone know how I can call functions stored as variables in an array?

Ive uploaded what Im trying to do to jsFiddle at http://jsfiddle.net/EcvKj/, as you can see Ive not really done much on it yet, its just to get my ideas down and possibly working.

Thanks in advance for any support any one can provide.
Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE