埋め込みオブジェクトのsrc属性を変更したい。私は持っています:
<embed class="flash "id="flash" src="swf/pano.swf?panoSrc=images/a.jpg"
allowFullScreen="true"
width="1280" height="640" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" bgcolor="#DDDDDD"/>
そして私は試しました
function change()
{
document.getElementById("flash").setAttribute('src', 'swf/pano.swf?panoSrc=b.jpg');
}
ただし、Chromeでは機能せず、Firefox、IE、Operaでのみ機能しました。どうすれば修正できますか(Chromeで機能させるため)?私は何か間違ったことをしましたか?
編集:これがHTMLファイル全体です
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script>
function change() {
document.getElementById("flash").setAttribute('src', 'swf/pano.swf?panoSrc=a.jpg');
}
</script>
</head>
<body>
<embed class="flash" id="flash" src="swf/pano.swf?panoSrc=images/sau.jpg" allowFullScreen="true"
width="1280" height="640" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" bgcolor="#DDDDDD"/>
<script>
change();
</script>
</body>
ページへのリンク:http://chin.comli.com/test.html