Ver Mensaje Individual
  #14 (permalink)  
Antiguo 10/10/2012, 09:32
Avatar de h2swider
h2swider
 
Fecha de Ingreso: julio-2007
Ubicación: Ciudad de Buenos Aires
Mensajes: 932
Antigüedad: 17 años, 3 meses
Puntos: 194
Respuesta: Condicion para que salga imagen Loading

satjaen, te recomiendo que no uses ajax nativamente si ya estas usando jquery que te facilita mucho las cosas, en vez de estar consultando por estados de la respuesta, podes usar perfectamente los callbacks de ajax en jquery.

Jquery ajax callbacks
Here are the callback hooks provided by $.ajax():

beforeSend callback is invoked; it receives the jqXHR object and the settings map as parameters.
error callbacks are invoked, in the order they are registered, if the request fails. They receive the jqXHR, a string indicating the error type, and an exception object if applicable. Some built-in errors will provide a string as the exception object: "abort", "timeout", "No Transport".
dataFilter callback is invoked immediately upon successful receipt of response data. It receives the returned data and the value of dataType, and must return the (possibly altered) data to pass on to success.
success callbacks are then invoked, in the order they are registered, if the request succeeds. They receive the returned data, a string containing the success code, and the jqXHR object.
complete callbacks fire, in the order they are registered, when the request finishes, whether in failure or success. They receive the jqXHR object, as well as a string containing the success or error code.
__________________
Codifica siempre como si la persona que finalmente mantedra tu código sea un psicópata violento que sabe donde vives