刷新时的JavaScript随机文本:不能添加超过10个随机引号

刷新时的JavaScript随机文本:不能添加超过10个随机引号,javascript,text,random,refresh,rotator,Javascript,Text,Random,Refresh,Rotator,我在刷新时使用此javascript随机文本旋转器: // JavaScript Document var theText = new Array() // do not change this theText[0] = 'xxx'; theText[1] = 'xxx'; theText[2] = 'xxx'; theText[3] = 'xxx'; theText[4] = 'xxx'; theText[5] = 'xxx'; theText[6] = 'xxx'; theText[7]

我在刷新时使用此javascript随机文本旋转器:

// JavaScript Document

var theText = new Array() // do not change this

theText[0] = 'xxx';
theText[1] = 'xxx';
theText[2] = 'xxx';
theText[3] = 'xxx';
theText[4] = 'xxx';
theText[5] = 'xxx';
theText[6] = 'xxx';
theText[7] = 'xxx';
theText[8] = 'xxx';
theText[9] = 'xxx';
theText[50] = 'xxx';
theText[51] = 'xxx';
theText[52] = 'xxx';
theText[53] = 'xxx';
theText[54] = 'xxx';
theText[55] = 'xxx';
theText[56] = 'xxx';
theText[57] = 'xxx';
theText[58] = 'xxx';
theText[59] = 'xxx';
theText[60] = 'xxx';
theText[61] = 'xxx';
theText[62] = 'xxx';
theText[63] = 'xxx';
theText[64] = 'xxx';
theText[65] = 'xxx';
theText[66] = 'xxx';
theText[67] = 'xxx';
theText[68] = 'xxx';
theText[69] = 'xxx';
theText[70] = 'xxx';
theText[71] = 'xxx';
theText[72] = 'xxx';
theText[73] = 'xxx';
theText[74] = 'xxx';
theText[75] = 'xxx';
theText[76] = 'xxx';
theText[77] = 'xxx';
theText[78] = 'xxx';
theText[79] = 'xxx';
theText[80] = 'xxx';
theText[81] = 'xxx';
theText[82] = 'xxx';
theText[83] = 'xxx';
theText[84] = 'xxx';
theText[85] = 'xxx';
theText[86] = 'xxx';
theText[87] = 'xxx';
theText[88] = 'xxx';
theText[89] = 'xxx';
theText[90] = 'xxx';
theText[91] = 'xxx';
theText[92] = 'xxx';
theText[93] = 'xxx';
theText[94] = 'xxx';
theText[95] = 'xxx';
theText[96] = 'xxx';
theText[97] = 'xxx';
theText[98] = 'xxx';
theText[99] = 'xxx';

// do not edit anything below this line

var j = 0
var p = theText.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Array()
   preBuffer[i].src = theText[i]
}
var whichText = Math.round(Math.random()*(p-1));
function showText(){
//This a wrapper for the text array it can be changed if need
document.write('<p class="thetext'+theText[whichText]+'</p>');
}




//and then the call function...
showText();
而且,如果不正确地对它们进行编号,则无法使其正常工作

您不能添加超过10个不同的引号,因为它根本不会使用它们。 如何使此脚本使用超过10个引号


也许是0-99个引号

你能给我们看看你的js代码吗?需要更多的代码描述这里的政策是问答应该包括所有需要的信息。你也可以通过外部资源/代码的链接来支持它们,但这并不意味着你的文章在出现死链接的情况下应该能够生存。即使我将代码作为代码突出显示,也不允许我提交问题!请帮忙!从您的pastebin代码中,我没有得到您实际需要的,请注意document.write,p标记关闭中缺少了一个小错误。它一定像document.write“

”+thetext[whichText]+'

”;或文档。写“

”;