2013-03-20 36 views

回答

0

嘗試使用javascript:

<script type="text/javascript">function abrirVentana(url) { 
window.open(url, "nuevo"); 
} 
</script> 

然後將HTML:

<a href="#" onClick="abrirVentana('http://')"></a> 
+0

所以,如何在TCPDF中使用此代碼?你有沒有試過類似的東西? – 2013-04-01 11:40:21

0

另一種方法是這樣的:

<script type="text/javascript">function openExternal(){ 
if(!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName(’a'); 
for(var i = 0; i < anchors.length; i++){ 
    var thisAnchor = anchors[i]; 
    if(thisAnchor.getAttribute(’href’) && thisAnchor.getAttribute(’rel’) == ‘external’){ 
     thisAnchor.target = ‘_blank’; 
    } 
} 
} 

window.onload = openExternal; 
</script> 
<a href="http://" rel=」external」></a> 
相關問題