var codeToExecute = "My.Namespace.functionName()"; var tmpFunc = new Function(codeToExecute); tmpFunc();