Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/04/2015, 08:48
Andrew777
 
Fecha de Ingreso: junio-2009
Ubicación: Bolivia
Mensajes: 96
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: error en script

Gracias diurno, ya pude resolverlo cambiando el codigo de la siguiente forma:


Código Javascript:
Ver original
  1. (function(){
  2.     $(".boton_envio").click(function() {
  3.  
  4.         var nombre = $(".nombre").val();
  5.             email = $(".email").val();
  6.             validacion_email = /^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/;
  7.             telefono = $(".telefono").val();
  8.             mensaje = $(".mensaje").val();
  9.  
  10.         if (nombre == "") {
  11.             $(".nombre").focus();
  12.             return false;
  13.         }else if(email == "" || !validacion_email.test(email)){
  14.             $(".email").focus();    
  15.             return false;
  16.         }else if(telefono == ""){
  17.             $(".telefono").focus();
  18.             return false;
  19.         }else if(mensaje == ""){
  20.             $(".mensaje").focus();
  21.             return false;
  22.         }else{
  23.             $('.ajaxgif').removeClass('hide');
  24.             var datos = 'nombre='+ nombre + '&email=' + email + '&telefono=' + telefono + '&mensaje=' + mensaje;
  25.             $.ajax({
  26.                 type: "POST",
  27.                 url: "proceso.php",
  28.                 data: datos,
  29.                 success: function(data) {
  30.                     $('.ajaxgif').hide();
  31.                     $('.msg').text('Mensaje enviado!').addClass('msg_ok').animate({ 'right' : '130px' }, 300);  
  32.                    
  33.                     alert(data);
  34.                 },
  35.                 error: function() {
  36.                     $('.ajaxgif').hide();
  37.                     $('.msg').text('Hubo un error!').addClass('msg_error').animate({ 'right' : '130px' }, 300);                
  38.                 }
  39.             });
  40.             return false;
  41.         }
  42.  
  43.     });
  44. })();

Tambien volvi a conseguir otra version de jquery 1.4.2 y con esta la probe y funciono, gracias por la ayuda.

SALUDOS CORDIALES