Afficher javascript dans fonction
Bonsoir a tous,
Voila j'ai un player audio dans lequel j'ai un code javascript me permet de g�n�rer l'embed code suivant la largeur qu'entre au pr�alable le visiteur (comme youtube et cie).
Le seul probl�me c'est qu'il faut que j'int�gre en fin de ce code g�n�r� (apr�s la feuille de style) cette ligne <script type="text/javascript" src="http://www.monsite.fr/player/AudioPlayerV2.js"></script> mais �a ne marche pas si je l'ajoute comme telle.
J'ai essay� les antislash, les ' au lieu de " mais aussi document.getElementById('SEBG').innerHTML plut�t que document.getElementById('SEBG').value, rien ne marche.
Quelqu'un peut il m'aider, please !
Code:
1 2 3 4 5 6 7 8 9 10
| <script type="text/javascript">
function IsNumeric(val){
return !isNaN(parseFloat(val));
}
function genere(){
var width=document.getElementById('SEBW').value;
if(IsNumeric(width)){document.getElementById('SEBG').value='<div style"width:' + width + 'px;" class="HrsdvrsPlayer"><div id="Share"><a id="ST" href="http://twitter.com/home?status=Discover an original and exclusive mixtape from <?php the_title();?> - <?php the_permalink();?> (cc @hrsdvrs)" target="_blank"></a><a id="SF" href="http://www.facebook.com/share.php?u=<?php the_permalink();?>" onclick="window.open(this.href,\'_blank\',\'height=400,width=600\');return false"></a><a id="SE" target="_blank" href="<?php the_permalink();?>"></a><a id="GM" href="http://www.monsite.fr/music/Seapony_Dreaming.mp3"></a><a id="LgHrsdvrs" target="_blank" href="<?php the_permalink();?>"></a></div><img class="HrsdvrsCover" src="http://www.monsite.fr/pochettes/seapony-album-art.jpg"/><div id="Title">Dreaming</div><div id="Artist">Seapony</div><audio class="AudioPlayerV1" width="' + (parseInt(width,10)-48) + '" preload="none"><source src="http://www.monsite.fr/music/Seapony_Dreaming.mp3" type="audio/mpeg"/></audio></div><link rel="stylesheet" href="http://www.monsite.fr/player/style.css" type="text/css" media="screen"/>';}
else {alert("Please enter numbers, only numbers");document.getElementById('SEBW').value='';}
}
</script> |
Merci d'avance, Alexis.