Bonjour , malgré plusieurs recherches je n'arrive toujours pas a trouver une solution à mon problème .
J'ai une base de donnée MySql avec des liens url de vidéos youtube à l'intérieur.
Le but est de cliquer sur un bouton et de modifier dynamiquement une vidéo.
Le problème c'est que mon code fonctionne bien sur Firefox mais ne fonctionne pas sur IE ni sur Chrome.
La vidéo ne se change pas et cela m'affiche l'erreursur IE.error : 'null' is null or not an object
Parcontre sur chrome je n'ai pas d'erreur , quand je clique rien ne se passe et il y a juste des warnings :Je pense que le problème doit soit venir du bouton et de "onclick" soit de mon code javascript avec document.getElementById[""] . Mais je n'arrive pas a trouver la solution au problème afin que le code soit compatible tous navigateurResource interpreted as image but transferred with MIME type text/html.
Mon code source :
Je vous remercie par avance de vos aides .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 <script language="Javascript"> function change_flash(url) { isIE = (document.all)?true:false; //IE 6 isNN6 = (document.getElementById)?true:false; if (isIE) var d = document.getElementById["flash"]; if (isIE) var d2 = document.getElementById["moz"]; var d = document.getElementById("flash"); var d2 = document.getElementById("moz"); if (isIE) d.setAttribute("value","http://www.youtube.com/v/0grIGnsRejo?fs=1&hl=fr_FR"); if (isIE) d2.setAttribute("src","http://www.youtube.com/v/0grIGnsRejo?fs=1&hl=fr_FR"); if (isNN6) d.value=url; if (isNN6)d2.src=url; document.getElementById("flash").style.display="none"; document.getElementById("flash").style.display=""; document.getElementById("moz").style.display="none"; document.getElementById("moz").style.display=""; } </script> <?php $hier2 = date("Y-m-d", strtotime("-1 day")); echo '<table style=" font-size: 12px; border-left: 2px outset grey;border-top: 2px outset grey;border-bottom: 3px outset grey;border-right: 3px outset grey; width:96% ";> <tr style="border:1px solid black;width:20%;"> <th style=" background-color:silver; border:1px solid black;width:30;text-align:center">Ligue</th> <th style=" background-color:silver; border:1px solid black;width:100;text-align:center">Domicile</th> <th style="background-color:silver; border:1px solid black;width:40;text-align:center">Score</th> <th style="background-color:silver; border:1px solid black;width:100;text-align:center">Visiteur</th> <th style="background-color:silver; border:1px solid black;width:55;text-align:center">Heure</th> <th style="background-color:silver; border:1px solid black;width:70;text-align:center">Chaine</th> <th style=" background-color:silver; border:1px solid black;width:70;text-align:center">Résumé</th> </tr> '; $matchhier = mysql_query("SELECT * FROM match2 WHERE date = '$hier2' ORDER BY heure ASC"); while($row = mysql_fetch_array($matchhier)) { echo ' <tr> <td style="border:1px solid black;width:30;text-align:center"><img src="ligues/'.$row['ligue'].'.png" width="30" height="30"></td> <td style="border:1px solid black;width:100;text-align:center">'.$row['team1'].'</td> <td style="border:1px solid black;width:40;text-align:center">'.$row['scteam1'].' - '.$row['scteam2'].'</td> <td style="border:1px solid black;width:100;text-align:center">'.$row['team2'].'</td> <td style="border:1px solid black;width:55;text-align:center">'.$row['heure'].'</td> <td style="border:1px solid black;width:70;text-align:center"><img src="chaines/'.$row['chaine'].'.gif" width="70" height="30"></td> <td style="border:1px solid black;width:70;text-align:center"><button type="button" onclick="change_flash(\''.$row['resume'].'\')"><img src="resume/youtube.png" width="70" height="30" BORDER="0"></button></td>'; } ?> </table> <div> <center> <object width="480" height="385"><param id="flash" value="http://www.youtube.com/v/xsMzh1i_kos?fs=1&hl=fr_FR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed id="moz" src="http://www.youtube.com/v/xsMzh1i_kos?fs=1&hl=fr_FR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> </center> </div>
Partager