I have string logo.cr.Button and function 
logo.cr.Button = function(){
 //something
}
var strg = 'logo.cr.Button';
strg();
now somehow i have to make that string a function call
like strg(); but it is saying 
strg is not a constructor
here
I have string logo.cr.Button and function 
logo.cr.Button = function(){
 //something
}
var strg = 'logo.cr.Button';
strg();
now somehow i have to make that string a function call
like strg(); but it is saying 
strg is not a constructor
here
 
    
    This won't work because JavaScript thinks you are using dot notation. When you write logo.cr.Button() JavaScript is looking for a function  Button() within the object  cr which is in the object logo.
I recommend changing the name to logoCrButton = function()...
 
    
    You could use eval, but its not recommended. Secury issues are just one reason, because an user might exploit eval to execute different code that is not supposed to be executed. Within this question it is explained fully.
var logo={cr:{}};
logo.cr.Button = function(){
  console.log("something");
}
var string = "logo.cr.Button()";
eval(string);If you can avoid eval then use a normal function call, an object or an array instead. For insteads Iterating through an array is much better and more stable compared to evaluating some parameters dynamically, as you can see here.
This second example does not use eval, but nevertheless you can call a certain function by using a string:
var obj={logo:{cr:{Button:function(){console.log("something");}}}};
var string = "logo.cr.Button";
function callFunctionByString(string,obj){
  var parts = string.split('.');
  parts.forEach(function(part){
    obj = obj[part];
  });
  obj();
}
callFunctionByString(string,obj);Hope this helps.
 
    
     
    
    Use eval("logo.cr.Button")();
This will execute the function, of course if you have an object like:
var logo = {
    cr: {
    }
};
 
    
    Generally when we write JavaScript functions the resulting function declaration looks like this:
function demo() {
  // function stuff here
}
You’re probably more than aware that “In JavaScript Functions are first-class Objects”. It’s a phrase that is spouted everywhere, and for good reason. It’s a very powerful idea that has worked to elevate JavaScript to where it is. We’re not going into the details of first-class objects here. All we care about is the fact that, in JavaScript, functions are objects. This means that the above function can also be declared by calling its Constructor:
var demo = new Function();
Now lets imagine we have a function with parameters and instructions:
function demo(name, age) {
  console.log('my name is ' + name);
  console.log('my age is ' + age);
}
and now to convert it to Constructor syntax:
var demo = new Function(
  "name,age",
  "console.log('my name is ' + name);" + 
  "console.log('my age is ' + age);"
);
This makes it pretty easy to see that these two functions are the same, they are just declared differently. The important difference is that one has easily accessible strings that we should be able to manipulate.
This applies to your function in a very similar way.
var strfunc = new Function ("", "logo.cr.Button()");
I can't seem to format this because I'm on mobile. But i will asap.
 
    
    