у меня есть js скрипт он ищет по заданному ключевому слову похожее слово в текстовой базе и выдает страницу с найденным.Но,вот в чем проблема он ищет только по 50 словам,а мне нужно 2000 и более,подскажите в чем проблема.
Вот собственно скрипт
он находится в самой базе daabase1.txt)
Keyword = new Object();
Address = new Object();
Keyword[0] = 50
Keyword[1] = "dolcevita 2801"
Address[1] = "http://zambaiti.su/dolcevita.html"
Keyword[2] = "dolcevita 2802."
Address[2] = "http://zambaiti.su/dolcevita.html"
Keyword[3] = "dolcevita 2803."
Address[3] = "http://zambaiti.su/dolcevita.html"
Keyword[4] = "dolcevita 2805."
Address[4] = "http://zambaiti.su/dolcevita.html"
Keyword[5] = "dolcevita 2808."
Address[5] = "http://zambaiti.su/dolcevita.html"
Keyword[6] = "dolcevita 2809."
Address[6] = "http://zambaiti.su/dolcevita.html"
Keyword[7] = "dolcevita 2810."
Address[7] = "http://zambaiti.su/dolcevita.html"
Keyword[8] = "dolcevita 2811."
Address[8] = "http://zambaiti.su/dolcevita.html"
Keyword[9] = "dolcevita 2812."
Address[9] = "http://zambaiti.su/dolcevita.html"
Keyword[10] = "dolcevita 2814."
Address[10] = "http://zambaiti.su/dolcevita.html"
Keyword[11] = "dolcevita 2817."
Address[11] = "http://zambaiti.su/dolcevita.html"
Keyword[12] = "dolcevita 2818."
Address[12] = "http://zambaiti.su/dolcevita.html"
Keyword[13] = "dolcevita 2819."
Address[13] = "http://zambaiti.su/dolcevita.html"
Keyword[14] = "dolcevita 2820."
Address[14] = "http://zambaiti.su/dolcevita.html"
Keyword[15] = "dolcevita 2821."
Address[15] = "http://zambaiti.su/dolcevita.html"
Keyword[16] = "dolcevita 2822."
Address[16] = "http://zambaiti.su/dolcevita.html"
Keyword[17] = "dolcevita 2823."
Address[17] = "http://zambaiti.su/dolcevita.html"
Keyword[18] = "dolcevita 2824."
Address[18] = "http://zambaiti.su/dolcevita.html"
Keyword[19] = "dolcevita 2825."
Address[19] = "http://zambaiti.su/dolcevita.html"
Keyword[20] = "dolcevita 2826."
Address[20] = "http://zambaiti.su/dolcevita.html"
Keyword[21] = "dolcevita 2827."
Address[21] = "http://zambaiti.su/dolcevita.html"
Keyword[22] = "dolcevita 2829."
Address[22] = "http://zambaiti.su/dolcevita.html"
Keyword[23] = "dolcevita 2830."
Address[23] = "http://zambaiti.su/dolcevita.html"
Keyword[24] = "dolcevita 2831."
Address[24] = "http://zambaiti.su/dolcevita.html"
Keyword[25] = "dolcevita 2832."
Address[25] = "http://zambaiti.su/dolcevita.html"
Keyword[26] = "dolcevita 2833."
Address[26] = "http://zambaiti.su/dolcevita.html"
Keyword[27] = "dolcevita 2834."
Address[27] = "http://zambaiti.su/dolcevita.html"
Keyword[28] = "dolcevita 2835."
Address[28] = "http://zambaiti.su/dolcevita.html"
Keyword[29] = "dolcevita 2836."
Address[29] = "http://zambaiti.su/dolcevita.html"
Keyword[30] = "dolcevita 2837."
Address[30] = "http://zambaiti.su/dolcevita.html"
Keyword[31] = "dolcevita 2840."
Address[31]= "http://zambaiti.su/dolcevita.html"
Keyword[32] = "dolcevita 2841."
Address[32] = "http://zambaiti.su/dolcevita.html"
Keyword[33] = "dolcevita 2842."
Address[33] = "http://zambaiti.su/dolcevita.html"
Keyword[34] = "dolcevita 2843."
Address[34] = "http://zambaiti.su/dolcevita.html"
Keyword[35] = "dolcevita 2844."
Address[35] = "http://zambaiti.su/dolcevita.html"
Keyword[36] = "dolcevita 2845."
Address[36] = "http://zambaiti.su/dolcevita.html"
Keyword[37] = "dolcevita 2846."
Address[37] = "http://zambaiti.su/dolcevita.html"
Keyword[38] = "dolcevita 2847."
Address[38] = "http://zambaiti.su/dolcevita.html"
Keyword[39] = "dolcevita 2848."
Address[39] = "http://zambaiti.su/dolcevita.html"
Keyword[40] = "dolcevita 2850."
Address[40] = "http://zambaiti.su/dolcevita.html"
Keyword[41] = "dolcevita 2851."
Address[41] = "http://zambaiti.su/dolcevita.html"
Keyword[42] = "dolcevita 2852."
Address[42] = "http://zambaiti.su/dolcevita.html"
Keyword[43] = "dolcevita 2853."
Address[43] = "http://zambaiti.su/dolcevita.html"
Keyword[44] = "dolcevita 2854."
Address[44] = "http://zambaiti.su/dolcevita.html"
Keyword[45] = "dolcevita 2855."
Address[45] = "http://zambaiti.su/dolcevita.html"
Keyword[46] = "dolcevita 2856."
Address[46] = "http://zambaiti.su/dolcevita.html"
Keyword[47] = "dolcevita 2857."
Address[47] = "http://zambaiti.su/dolcevita.html"
Keyword[48] = "dolcevita 2858."
Address[48] = "http://zambaiti.su/dolcevita.html"
Keyword[49] = "dolcevita 2859."
Address[49] = "http://zambaiti.su/dolcevita.html"
Keyword[50] = "dolcevita 2860."
Address[50] = "http://zambaiti.su/dolcevita.html"
Keyword[51] = "dolcevita 2861."
Address[51] = "http://zambaiti.su/dolcevita.html"
Keyword[52] = "dolcevita 2862."
Address[52] = "http://zambaiti.su/dolcevita.html"
Keyword[53] = "dolcevita 2863."
Address[53] = "http://zambaiti.su/dolcevita.html"
Keyword[54] = "dolcevita 2864."
Address[54] = "http://zambaiti.su/dolcevita.html"
Keyword[55] = "architexture 4000."
Address[55] = "http://zambaiti.su/architexture.html"
Keyword[56] = "lions 4256."
Address[56] = "http://zambaiti.su/lions.html"
function contains(sub,s){
strlen1=sub.length
strlen2=s.length
istrue=false
for(i=0;i<=strlen2;i++)
{
comp=s.substring(i-1,strlen2)
comp=comp.substring(0,strlen1)
if(comp==sub){
istrue=true
break
}
}
return istrue
}
function dolt() {
loopCount=0;
var Found=false
var Item=document.forms[0].sub.value.toLowerCase();
stats='toolbar=no,location=no,scrollbars=yes,direc tories=no,status=yes,menubar=no,height=500,width=7 90,top=0,left=0'
stats += 'scrollbars=yes,resizable=yes'
MsgBox = window.open ("","msgWindow",stats)
MsgBox.opener = window;
MsgBox.opener.name = "opener";
MsgBox.document.write("<head><title>Результ ат поиска: для "+Item+"</title></head>");
if(document.form1.sub.value=="")
MsgBox.document.write('<h5><font face="Verdana,Arial,Helvetica" color="#0000000">Результат поиска: ничего не найдено<HR></h5></font>');
else
MsgBox.document.write('<h5><font face="Verdana,Arial,Helvetica" color="#0000000">Результат поиска: для '+Item+'<HR></h5></font>');
for(var i=1; i<=Keyword[0]; i++){
contains(Item,Keyword[i].toLowerCase())
if(comp==Item){
loopCount++;
Found=true;
MsgBox.document.write('<div align="center"><center><table border="0" width="740" cellspacing="0" cellpadding="8"><tr><td width="2%" bgcolor="#FFFffF" height="18"align="center"><font face="Verdana,Arial,Helvetica" size="2" color="#000000"><h5>'+loopCount+'. </h5></font></td> <td width="150%" bgcolor="#FFFFFF" height="18" align="left"><font color="#000000"></font><fontcolor="#000000"><font face="Verdana,Arial,Helvetica" size="2" color="#000000">'+Keyword[i]+'<BR><A HREF='+Address[i]+' target="_blank">Перейти на страницу</A></font></h1></font><font color="#0000000"></font></td></tr></table></center></div>')
MsgBox.document.write('<script Language="JavaScript">window.status=("Total '+loopCount+' found")</'+'script'+'>');
}
}
if(!Found)
MsgBox.document.write('<font face="Verdana,Arial,Helvetica" size="2" color="#FF0000">Извините,по-вашему запросу ничего ненайдено!</font>')
MsgBox.document.write('<font face="Verdana,Arial,Helvetica" size="2" color="#0F219B"><p align="center"><HR><a href="http://www.artsuhinin.ru/">веб-студия Сухинина Артема</a></p></font>')
MsgBox.document.write('<style><!--A:link{color: #FF0000; text-decoration:none} A:visited {color: #FF9950; text-decoration:none}--></style>')
if(loopCount==0){
MsgBox.document.write('<script Language="JavaScript">window.status=("Total 0 found")</'+'script'+'>');
}
}
а так он прикрепляется к странице
<center>
<div class="content">
<script src="database1.txt"></script>
<table class="big" border="0" cellpadding="0" cellspacing="3">
<tbody>
<tr>
<td style="height: 50px;"></td>
<td></td>
<td>
<center><!-- BODY START HERE -->
<p><span style="font-weight: bold;">Поиск по базе</span></p>
<form method="post" name="form1">
<p>   ;
<input name="sub" size="20" type="text">
<input value="Поиск" onclick="dolt()" type="button"></p>
</form>
Введите: артикул(пример: 2700) или название коллекции<br>
и нажмите кнопку "Поиск" чтобы увидеть результат.
</center>