utiliser la fonction onclick window open
bonjour
je dois transférer une instruction d'un fichier hpage.inc dans un autre: skin.inc
sur ma page j'ai des drapeaux ouvrant une page de traduction google.
dans hpage.inc j'ai ce code qui fonctionne quand on clique sur les drapeaux.
<
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| !-- début de code google translate -->
<div style="width:100%">
<div style="float:right;height:16px;margin:6px 0;">
<?php
if ($lng == 'en') {
?>
<a rel="nofollow" onclick="window.open('http://www.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=en%7Cpt&hl=en&ie=UTF8'); return false;" title="Traduction Anglais Portugais">
<img height="16" border="0" width="24" style="cursor: pointer;" alt="Translate English to Portuguese " src="img/drapeaux/pt.gif" title="Translate English to Portuguese" /></a>
<?php
}
?>
</div>
<!-- fin de code drapeaux google translate --> |
quand je rentre ce code ci dessous dans le fichier skin.inc à l'intérieur de la balise $tabup j'ai toujours un drapeau mais aucune fenetre ne s'ouvre au clic
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| // <!-- Essai div drapeaux traduction dans skin.inc -->
if ($lng == 'en') {
$tabup .= "<div style='width:100%'>
<div style= 'position:absolute;right:200px; top: 155px; z-index:100;'>
<a rel='nofollow' onclick='window.open('http://www.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=en%7Cpt&hl=en&ie=UTF8'); return false;' title='Traduction Anglais Portugais'>
<img height='16' border='0' width='24' style='cursor: pointer;' src='".CHEMIN." img/drapeaux/pt.gif' alt='Translate Try ' title='Translate Try'/></a>
</div>
</div> ";
}
//<!-- Essai div drapeaux traduction dans skin.inc --> |
quelle erreur de syntaxe ai je fait?
merci d'avance
didier