Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [prototype] problem z odpaleniem funkcji
pawel.s
post
Post #1





Grupa: Zarejestrowani
Postów: 69
Pomógł: 2
Dołączył: 15.08.2007
Skąd: trojmiasto

Ostrzeżenie: (0%)
-----


Witajcie,
  1. var questionsClass = Class.create({
  2. initialize: function() {
  3.  
  4. },
  5. showQuestion: function(type) {
  6. var obj = $('say');
  7. a = new Element('a')
  8. a.setAttribute('href', '#')
  9. a.onclick = function(){
  10. this.test()
  11. }
  12. a.innerHTML = 'wybierz'
  13.  
  14. obj.appendChild(a)
  15. });
  16. },
  17.  
  18. onFailure: function(){
  19. alert('Something went wrong...');
  20. }
  21. });
  22. },
  23.  
  24. test: function() {
  25. alert('cos');
  26. }
  27. });

chcialbym funkcje "test" odpalic na onclick ale przez this.test() nie dziala

Ten post edytował pawel.s 10.07.2009, 14:49:26
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 06:49