Voici mon petit problème posté sur
http://www.phpcs.com/ par mégarde:
<HR>
Mon code PHP est le suivant:
<?
function affiche($path) {
$folder=dir($path);
$liste=array();
$i=0;
while($fichier=$folder->read()){
if($fichier!="." && $fichier!=".."){
$liste[$i]=$fichier;
$i++;
}
}
echo "<script type='text/javascript'><!-- function montres() {";
for($j=0;$j<$i;$j++) {
echo "window.open('./$liste[$j]','detest');";
;
}
echo ";} //--></script>$i images";
}
?>
<HR>
Ce qui me donne le code Html/Javascript suivant:
<script type='text/javascript'><!-- function montres() {'window.open('./Arbres.jpg','detest');window.open('./Arbres_color.jpg','detest');} //--></script>2 images
<HR>
Alors mon php marche mais quand j'execute mon javascript en cliquant sur le lien, J'ai une erreur Javascript: 'Objet attendu'. Il-y-a-t'il une erreur de syntaxe? - merci
Bien à vous
Valembois Sébastian