Bonjour à tous :)
Voila, je suis confronté à un petit probleme.
je suis dans une classe, j'ai une fonction
function myClass () {
this.myFunc = function () {
alert ("youpi :)");
}
this.call = function (calledFunc) {
this.calledFunc ();
}
}
et j'aimerai faire
myC = new myClass ();
myC.call ("myFunc");
pour que ca m'affiche Youpi :) en alert
Bien sur, cela ne marche pas :p, mais comment faire ?
j'ai tenté de faire
myC = new myClass ();
myC.call (myC.myFunc);
et
myC.call (myClass.myFunc);
Mais rien ne marche :/
Une idée ?