リンクをクリックすると、(定義済みのリストから) ランダムなホームページが表示されるようにします。本当にこれは 2 つの質問なので、質問 1 は可能ですか? はいの場合、どのように?
ファイルが別のフォルダにある場合はどうなりますか? コードは次のようになりますか?
var arrPages = [ 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/feyra/feyra.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/rayne/rayne.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/adrienna/adrienna.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/averya/aveyra.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/demaen/demaen.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/phoenyx/phoenyx.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/raven/raven.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/trysten/trysten.html', 'http://neo.graceland.edu/~rmthomas/gothyc%20cafe/xiandre/xiandre.html'];
document.getElementById('13').onclick = function () {
var randUrl = arrPages[Math.floor(Math.random() * arrPages.length)];
// Redirect/popup/new tab
window.open(randUrl,'test');
}