Valcha Posted December 5, 2006 Report Share Posted December 5, 2006 Man ir tas gadījums, kad return neder, jo funkcija handleHttpResponse nepieņem mainīgos, bet toties ārpusfunkcijas mainīgos tā redz. Ko jūs iesakiet? Kā handleHttpResponse var uzzināt ajax funkcijas saņemto mainīgo vars? function ajax(data,vars) { //te notiek blablabla http.onreadystatechange = handleHttpResponse; } function handleHttpResponse() { if (http.readyState == 4) { ........................... } } Iepriekš paldies par padomu Link to comment Share on other sites More sharing options...
andrisp Posted December 5, 2006 Report Share Posted December 5, 2006 (edited) http.onreadystatechange = function() { handleHttpResponse(vars); } Palasi šo: http://developer.mozilla.org/en/docs/AJAX:Getting_Started Tur baigi smuki apstātīts, kas un kā. Edited December 5, 2006 by andrisp Link to comment Share on other sites More sharing options...
Valcha Posted December 5, 2006 Author Report Share Posted December 5, 2006 Andri, paldies, citos manuāļos tik smalki nebija aprakstīts. Palīdzēja! Link to comment Share on other sites More sharing options...
bubu Posted December 5, 2006 Report Share Posted December 5, 2006 Nu nevar būt, ka šitāda lieta (closure, anonymous function) nav aprakstīta JavaScript manuālī. Nez ko tu tur lasīji tad.. Link to comment Share on other sites More sharing options...
Delfins Posted December 6, 2006 Report Share Posted December 6, 2006 No senā topika... multiple requests, moš noder http://85.115.122.95/tests/ajax/ Link to comment Share on other sites More sharing options...
Recommended Posts