var questionsClass = Class.create({ initialize: function() { }, showQuestion: function(type) { var obj = $('say'); a = new Element('a') a.setAttribute('href', '#') a.onclick = function(){ this.test() } a.innerHTML = 'wybierz' obj.appendChild(a) }); }, onFailure: function(){ alert('Something went wrong...'); } }); }, test: function() { alert('cos'); } });
chcialbym funkcje "test" odpalic na onclick ale przez this.test() nie dziala