Juste pour essayer de comprendre Javascript, une chose très étrange est arrivée. La méthode getChapters()
tire même si je ne l'ai pas explicitement appelé ... Des idées? (Je reçois la boîte d'alerte pour obtenir des chapitres).Pourquoi cette méthode javascript se déclenche-t-elle même si je ne l'appelle pas?
videoChapters = function() {
};
videoChapters.prototype.config = {
jsonProvider : '_Chapters.aspx'
};
videoChapters.prototype.init = function() {
//get chapters
};
videoChapters.prototype.getChapters = new function() {
alert('getting chapters');
}
jQuery(document).ready(function() {
videoChapters = new videoChapters();
videoChapters.init();
});