Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/07/2013, 01:24
Avatar de vesper_metal90
vesper_metal90
 
Fecha de Ingreso: enero-2013
Mensajes: 103
Antigüedad: 11 años, 3 meses
Puntos: 1
Respuesta: obtener datos de una funcion callback

No soy muy experto pero tal vez esto te ayude..

El HTML
Código HTML:
Ver original
  1. <button type="button" id="Prueba">Probando</button>
  2.  <input id="resultado" type="text" value=""/>

El Js

Código Javascript:
Ver original
  1. $(function(){
  2.        
  3.         function Hola(){
  4.           var respuesta = "";
  5.           if(confirm("Esta seguro que deseas Eliminar")){
  6.             respuesta = 1;
  7.           }else{
  8.             respuesta = 0;
  9.           }
  10.          
  11.           return respuesta;
  12.         };              
  13.         $("#Prueba").click(function(){
  14.           var respuesta = Hola();
  15.           $("#resultado").val(respuesta);
  16.         });        
  17.                
  18.       });

Saludos espero haberte ayudado....