Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/01/2010, 14:00
luks77
 
Fecha de Ingreso: diciembre-2007
Mensajes: 274
Antigüedad: 16 años, 4 meses
Puntos: 0
Duda muy tonta, usar funcion con $.Ajax

Hola a todos, tengo una duda muy grande y tonta.

El codigo

Código Javascript:
Ver original
  1. $.ajax({
  2.            async:true,
  3.            type: "POST",
  4.            dataType: "html",
  5.            contentType: "application/x-www-form-urlencoded",
  6.            url:"mipagina.php",
  7.            data:"numero=10",
  8.            beforeSend:inicioEnvio,
  9.            success:creadaEnc,
  10.            timeout:4000,
  11.            error:problemas
  12.          });
  13. return false;
  14.  
  15. function problemas(id){
  16.   $("#"+id).text('Problemas en el servidor.');

Bueno, mi problema es q quiero pasar el valor de 'id' a la funcion. Probe poniendo


Código Javascript:
Ver original
  1. $.ajax({
  2.            async:true,
  3.            type: "POST",
  4.            dataType: "html",
  5.            contentType: "application/x-www-form-urlencoded",
  6.            url:"mipagina.php",
  7.            data:"numero=10",
  8.            beforeSend:inicioEnvio,
  9.            success:creadaEnc,
  10.            timeout:4000,
  11.            error:problemas('miId')
  12.          });

Pero no funciono... tambien probe

Código Javascript:
Ver original
  1. $.ajax({
  2.            async:true,
  3.            type: "POST",
  4.            dataType: "html",
  5.            contentType: "application/x-www-form-urlencoded",
  6.            url:"mipagina.php",
  7.            data:"numero=10",
  8.            beforeSend:inicioEnvio,
  9.            success:creadaEnc,
  10.            timeout:4000,
  11.            error:problemas{id="miId";}
  12.          });

Pero tampoco funciono.

Ojala puedan ayudarme


Desde ya Gracias