我希望我的VibeDeck脚本自动播放。它使用HTML中的href="#play"行在点击后调用它。
但问题是,我已经尝试让家长窗口重定向到#play。以及重定向到#play的实际iframe窗口。但它仍然不会自己玩。我真的很想知道是否有任何方法可以自动调用这个脚本的播放功能。目前位于
http://12-3.co.uk/
它是底部的播放列表。
您可以尝试将onLoad="functionYouCallToStartPlaying()"
属性添加到站点的body标记中。
或者:
<script>
function checkIfDefaultPage(pageAddress)
{
//basically check if the user is on the homepage and you have no #play in the URL,
//so the URL does not become http://12-3.co.uk/#play#play
if((pageAddress == "http://12-3.co.uk")||(pageAddress == "http://12-3.co.uk/"))
return true;
return false;
}
function jsRedirect()
{
if(checkIfDefaultPage(Document.Location))
Document.Location = Document.Location + "#play";
}
</script>
同时具有
<body onLoad="jsRedirect();">
这可能会使JavaScript重定向为您工作。
编辑:避免文档的灵感。您可能多次重定向的位置问题位于此处。