<a id="bgndVideo" href="http://www.youtube.com/watch?v=mAf6zKRb1wI"
class="movie {opacity:.8, isBgndMovie:{width:'window',mute:false}, o
ptimizeDisplay:true, showControls:true, ratio:'4/3', loop: true}">vito
acconci theme song 1973</a>
以上是我在文檔中用於嵌入javascript chromeless youtube播放器作爲背景的html。我得到的代碼從http://pupunzi.com/mb.components/mb.YTPlayer/demo/demo_background.html使用jquery利用dyanamically更改javascript youtube播放器的href
href控制設置爲背景的視頻我想用常量動態更改上述html的href。
我曾嘗試:
var DATA = VideoID
$("bgndVideo").attr("href", DATA)
這個沒有工作,也沒有
document.getElementById("bgndVideo").href=DATA;
這也不能工作。有什麼建議麼?在上面的示例網站上查看源代碼以更好地瞭解我的意思可能是一個好主意,我覺得很難正確表達我的問題!
您已經回答瞭如何將URL更改爲一組網址。問題是如何將url更改爲變量。 – user2330012 2013-04-28 23:22:03