I have a function prototype that loads data from a path. The trick is that I need to change the path afterward. I tried call, apply, bind and even assign but as I am a novice I did not find the solution.

Here a sample of my code : 

```
Chat.prototype.loadMessages = function() {

    this.messagesRef = this.database;

    var setMessage = function(data) {
    var val = data.val();
    this.displayMessage(data.key, val.name, val.text);
    }.bind(this);

};

var chat = new Chat
function setPath (newpath) {
chat.loadMessages.messageRef = newpath; // I guess, it is where I'm wrong...
chat.loadMessages(); // It should load messages from the new path in my chat container.
}

```

As I said I also tried :

```
chat.loadMessages.call(newpath);

```

or

```
 var setPath = function(newpath) {
      chat.loadMessages(newpath);
      }.bind(chat);
      setPath();
 chat.loadMessages();

```

But the chat container continues to disclose messages from the old path...