Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/06/2012, 19:30
nightramm
 
Fecha de Ingreso: septiembre-2008
Mensajes: 55
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Ejecutar funcion al presionar boton me gusta

Cita:
Iniciado por Panino5001 Ver Mensaje
Lo mejor para no perder tiempo es estudiar la documentación:
http://developers.facebook.com/docs/...ent.subscribe/
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Documento sin título</title>
</
head>

<
body>
<
div><div  id="fb-root"></div><fb:like href="http://www.forosdelweb.com/f13/ejecutar-funcion-presionar-boton-gusta-1001443/" width="120" font="lucida grande" colorscheme="light" data-send="false" data-layout="box_count" style="width:120px; height:60px; float:left;position:relative; "></fb:like></div>

<
script type="text/javascript">
function 
getScript(url,callback){
    var 
js document.createElement('script'),html document.documentElement;
    
js.src url;
    if(
callback){
        if(
js.addEventListener){
            
js.addEventListener('load',callback,false);
        }else{
            
js.onreadystatechange=function(){
                if(
js.readyState=='complete' || js.readyState=='loaded'){
                    
callback();
                }
            }
        }
    }
    
html.insertBefore(jshtml.lastChild);
}
getScript(
    
'http://connect.facebook.net/en_US/all.js#xfbml=1',
    function(){
        
FB.Event.subscribe(
            
'edge.create',
            function(
href,widget){
                
alert(href+'--'+widget);//lo que quieras ejecutar
            
}
        );                                                      
    }
);
</script>

</body>
</html> 
Muchas gracias Panino5001, si había leído la documentación pero sinceramente no sabía como aplicarla bien para lograr el objetivo. El ejemplo que pasaste funciona perfectamente.