Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/06/2011, 14:40
TragedyCL
 
Fecha de Ingreso: enero-2010
Mensajes: 39
Antigüedad: 14 años, 4 meses
Puntos: 1
[Jquery] Problema al pasar el signo "+" con Ajax

Estimados,
Tengo un problema con mi codigo y es que cuando en un textbox alguien pone un signo "+" este se pierde al enviarlo con $.ajax.

Mi codigo es el siguiente:

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. function envia()
  3. {
  4. var txt = $('#txt_nombre').val();
  5. $.ajax({
  6.     type        : "POST",
  7.     url     : "query/form.ajax.php",
  8.     data         : "texto="+txt;
  9.     dataType  : "html",
  10.  
  11.     success : function(devuelve)
  12.     {
  13.                 alert(devuelve);
  14.          }
  15. });
  16. }
  17. </script>

Código HTML:
Ver original
  1. <input type="text" id="txt_nombre" onchange="envia()">

El archivo que recibe es asi:

Código PHP:
Ver original
  1. <?
  2. echo $texto;
  3. ?>