By 05/02/2014 3 Comments

How to Call a JavaScript function as a string

Call function as a string in javascript

  • We can call a function as a string in javascript
  • We need this situation if we have requirement

The code fragment given below allows you to call a function simply by its name.


var strFuncName = "Function_Name"; //Name of the function to be called
var strFuncParam = "parameter"; //Parameters to be passed in function

//Create the function
var fn = window[strFuncName ];

//Call the function
fn(strFuncParam );


Posted in: JavaScript

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .