Here is my exemple :
function a(b)
{
b();
}
function b()
{
alert("d");
}
function c()
{
alert("e");
}
a(c);//Output e
With the fiddle : http://jsfiddle.net/YqeS3/
How can I fire the real b function from a?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your B function isn’t global, and you don’t want to use naming conventions, you could create an additional function
and call that one instead. I still think that you should simply name your argument and your function something else though, as it’d also create much less confusion for any other person (this include the future version of yourself) looking at your code.