Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/02/2014, 10:01
quico5
 
Fecha de Ingreso: enero-2008
Mensajes: 580
Antigüedad: 16 años, 3 meses
Puntos: 9
Respuesta: "a target=_blank..." no funciona usando "a href=javascript..."

Me pilla verde el JavaScript... A ver si consigo adaptarlo

Código:
https://developer.mozilla.org/es/docs/DOM/elemento.addEventListener
https://developer.mozilla.org/en-US/docs/Web/API/event.target
Cita:
Sintaxis
target.addEventListener(tipo, listener[, useCapture]); target.addEventListener(tipo, listener[, useCapture, aWantsUntrusted ]); // Gecko/Mozilla only
Código:
<a onclick="var dir=window.document.URL;var tit=window.document.title;var tit2=encodeURIComponent(tit);var dir2= encodeURIComponent(dir);window.location.href=('http://www.facebook.com/share.php?u='+dir2+'&amp;t='+tit2+'');" target="_blank">Compartir en Facebook</a>