如何向此脚本添加单击按钮循环 URL 功能(按给定顺序在 url 之间循环)或者是否可能?
<script type="text/javascript">
var urls = new Array();
urls[0] = "facebook.com";
urls[1] = "yahoo.com";
var random = Math.floor(Math.random()*urls.length);
window.location = urls[random];
</script>
如何向此脚本添加单击按钮循环 URL 功能(按给定顺序在 url 之间循环)或者是否可能?
<script type="text/javascript">
var urls = new Array();
urls[0] = "facebook.com";
urls[1] = "yahoo.com";
var random = Math.floor(Math.random()*urls.length);
window.location = urls[random];
</script>