![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 812 Pomógł: 117 Dołączył: 2.12.2008 Ostrzeżenie: (10%) ![]() ![]() |
Witam,
piszę klasę w javascript i utknąłem na pewnym problemie. A mianowicie w jednej z funkcji wywołuję zapytanie (ajax) do serwera. I teraz przy odebraniu wyniku z serwera, w miejscu gdzie umieściłem funkcję alert chciałbym odwołać się do innej funkcji w klasie. W jaki sposób to zrobić? Kod // include: jQery
this.funkcja = function(){ $.ajax({ type: 'POST', url: ..., data: ..., success: function(str){ alert(str); } }); } |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 589 Pomógł: 91 Dołączył: 22.05.2008 Skąd: Gliwice Ostrzeżenie: (0%) ![]() ![]() |
Kod this.foo = function(){
// somthing } this.funkcja = function(){ var thisInstance = this; $.ajax({ type: 'POST', url: ..., data: ..., success: function(str){ //alert(str); thisInstance.foo(); } }); } |
|
|
![]() ![]() |
![]() |
Aktualny czas: 25.08.2025 - 12:06 |