I'm using Javacript (with jQuery) to create a Manager object to my user interfaces. The general idea is capturing all clickable elements (defined with .clickable class) and then, based on the id of the element, create the corresponding object to deal with the action needed.

This is my Manager object definition:

```
function Manager() {

    this.init = function() {
        $('.clickable').click( function() {
            var l = this.id.split("_");
            var controller = Manager.ucfirst(l[0]) + "()";
            var action = l[1];
            var nclass = new controler;
        });
    };

    this.init();
}

```

When the user clicks a clickable element like

```
<a id="user_login" class="clickable">Login</a>

```

then this Manager should create an object User (the first part of the id with an uppercase first letter) and then execute method login (second part of the id).

But what happens, in fact, is that when I click the element I receive a "Uncaught TypeError: string is not a function".

Well, I know that string is not a function! But I am assuming Javascript is smart enoough to have something like the $$variable in PHP.

I've done some research but with no practical results. Would someone help me, please?