Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [AJAX][JavaScript]jQuery i ajax
Forum PHP.pl > Forum > Przedszkole
brayan.tr
Witam napisałem sobie taką funkcje, przedstawiam istotny fragment:
  1. $.ajax({
  2. type: "POST",
  3. url: "php/send_box.php",
  4. data: dataString,
  5. dataType: script,
  6. success: function() {
  7. $('.send-mail').fadeIn(700, function(){
  8. $('#email').val('');
  9. $('#tresc').val('');
  10. $('#dane').val('');
  11. $('#firma').val('');
  12. $('#phone').val('');
  13. $('.send-mail').delay(4000).fadeOut(700);
  14. });
  15. }
  16. });


W skupcie send_box.php jest kod zwracający returnem 0 albo 1. Jak ją odebrać w powyższej funkcji żeby dane dalej odpowiednio przetworzyć ?
nospor
Czy tak ciezko zajrzec do dokumentacji?
http://api.jquery.com/jQuery.ajax/
success(data, textStatus, jqXHR)Function, Array

I przykłady
Cytat
Example: Save some data to the server and notify the user once it's complete.
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
Example: Retrieve the latest version of an HTML page.
$.ajax({
url: "test.html",
cache: false,
success: function(html){
$("#results").append(html);
}
});
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.