Tema: Error NaN
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/12/2014, 14:30
Jose789
 
Fecha de Ingreso: diciembre-2012
Ubicación: Murcia
Mensajes: 329
Antigüedad: 11 años, 4 meses
Puntos: 4
Error NaN

Hola gente nuevamente tengo un problema con el siguiente script y es que me devuelve un error NaN.

Hice un var_dump($_POST) y me devuelve lo siguiente:
Cita:
array(1) {
["id"] =>
string(3) "NaN"
}
Código Javascript:
Ver original
  1. $('.staff').click(function(){
  2.     swal({
  3.         title: "¿Quiere continuar?",  
  4.         text: "Te seran descontados " + $(this).attr('data-price') + ' Scores.',  
  5.         type: "warning",  
  6.         showCancelButton: true,  
  7.         confirmButtonColor: "#DD6B55",  
  8.         cancelButtonText: "Cancelar",
  9.         confirmButtonText: "Confirmar",  
  10.         closeOnConfirm: false
  11.     }, function(){
  12.          $.post( "ajax/rewards_score.php", { bid: + $(this).attr('data-id') })
  13.             .done(function( data ) {
  14.             if(data == "ok") {
  15.                 swal("Super!", "Ha canjeado exitosamente", "success");
  16.             } if(data == "error") {
  17.                 swal("Oops...", "No tienes suficiente Score como para canjear ese premio.", "info");
  18.             } if(data == "fail") {
  19.                                swal("Oops...", "Ese premio no existe", "info");
  20.                         }
  21.         });
  22.     });
  23. });