我有這個代碼,只能在firefox中工作。JavaScript不工作在鉻/歌劇/ IE瀏覽器,但Firefox是優秀的!
<script type="text/javascript">
function setVideo(url){
url = url.replace("watch?v=","v/","i");
var movie = document.getElementById('movie');
movie.setAttribute('src',url+"&hl=en&fs=1&");
var param = document.getElementById('paramm');
param.setAttribute('value',url+"&hl=en&fs=1&");
}
</script>
<object width="425" height="344">
<param name="movie" id="paramm"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed id="movie" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344" src=""></embed>
</object>
<a href="#" onclick="setVideo('http://www.youtube.com/watch?v=3h1qQaRxY40')">example</a>
請幫忙,我不知道,這是一個這麼簡單的腳本,爲什麼它不工作? 謝謝
這段代碼應該做什麼?什麼不行?你得到什麼錯誤信息? – 2010-06-30 11:49:16