随机重定向到url,但有1个数字更改(通过Javascript)

随机重定向到url,但有1个数字更改(通过Javascript),javascript,html,url,redirect,random,Javascript,Html,Url,Redirect,Random,所以,我使用这个代码 var url=新数组(); URL[0]=“/truth”; URL[1]=“/truth1”; URL[2]=“truth2”; var random=Math.floor(Math.random()*url.length); window.location=URL[随机]; var url=新数组(); URL[0]=“/truth”; URL[1]=“/truth1”; URL[2]=“truth2”; var random=Math.floor(Math.

所以,我使用这个代码


var url=新数组();
URL[0]=“/truth”;
URL[1]=“/truth1”;
URL[2]=“truth2”;
var random=Math.floor(Math.random()*url.length);
window.location=URL[随机];

var url=新数组();
URL[0]=“/truth”;
URL[1]=“/truth1”;
URL[2]=“truth2”;
var random=Math.floor(Math.random()*url.length);
window.location=”https://truthordare0.weebly.com/“+URL[随机];

你的问题是什么?你想要什么还不清楚