Calling JavaScript function from String

by March 24, 2016 0 comments


var strFun = "someFunction";
var strParam = "this is the parameter";
 
//Create the function
var fn = window[strFun];
 
//Call the function
fn(strParam);

An Nguyen

Developer

Sharing daily exciting lesson learned and posts about .NET, SQL Server, HTML, Javascript - jQuery, CSS - Bootstrap, SalesForce CRM, Kentico CMS and so on.

0 comments :

Post a Comment