Country = new Object();
City = new Object();
Url = new Object();
City[0] = 1446
Country[1]="Mika Häkkinen"
City[1]="Østrig Grand Prix 1998. A1 Ring"
Url[1]="r-a1-ring98.htm"
Country[2]="David Coulthard"
City[2]="Østrig Grand Prix 1998. A1 Ring"
Url[2]="r-a1-ring98.htm"
Country[3]="Michael Schumacher"
City[3]="Østrig Grand Prix 1998. A1 Ring"
Url[3]="r-a1-ring98.htm"
.....
Country[1444]="Eddie Irvine"
City[1444]="Japan Grand Prix 2001. Suzuka"
Url[1444]="r-suzuka01.htm"
Country[1445]="Jean Alesi"
City[1445]="Japan Grand Prix 2001. Suzuka"
Url[1445]="r-suzuka01.htm"
Country[1446]="Kimi Raikkonen"
City[1446]="Japan Grand Prix 2001. Suzuka"
Url[1446]="r-suzuka01.htm"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Her er problemet...
function contains(sub,s){ | Her stopper den og
sige:
strlen1=sub.length | City[...] er null
eller ikke et objekt
strlen2=s.length | Kode: 0
istrue=false |
for(i=0;i<=strlen2;i++) | Hvis jeg mindske
antal af poster til under 999, er den okey
{ | men jeg
skal desværre bruge 1446 poster...
comp=s.substring(i-1,strlen2) |
comp=comp.substring(0,strlen1) | Der vil måske være nogle,
der siger at den ville være bedre
if(comp==sub){ | med ASP men ... jeg
kender ikke en s.... til ASP
istrue=true |
break | Er der nogle,
der kan knække denne kode?
}
} Firmaet, som
jeg har købt script af, er gået konkurs....
return istrue
}
function dolt2() {
loopCount=0;
var Found=false
var
Item=document.form2.sub.options[document.form2.sub.selectedIndex].value.toLo
werCase();
var
Tem=document.form2.countr.options[document.form2.countr.selectedIndex].value
..toLowerCase();
Tem2=document.form2.countr.options[document.form2.countr.selectedIndex].valu
e;
stats='toolbar=no,location=no,scrollbars=yes,directories=no,status=yes,menub
ar=no,height=500,width=390,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>Søgeresultatet...</title></head>");
MsgBox.document.write('<h5><font
face="Verdana,Arial,Helvetica">Søgeresultatet for:
'+Tem2+'<HR></h5></font>');
for(var i=1; i<=City[0]; i++){
contains(Item,City[i].toLowerCase());
if(comp==Item&Country[i].toLowerCase()==Tem){
loopCount++;
Found=true;
MsgBox.document.write('<div><center><table border="1" width="350"
cellspacing="0" cellpadding="4"><tr><td width="25" align="right"><font
face="Verdana,Arial,Helvetica" size="2" ><h5>'+loopCount+'.
</h5></font></td> <td width="325" align="left"><font
face="Verdana,Arial,Helvetica" size="2">'+City[i]+'<BR><A HREF='+Url[i]+'
target="main">Klik her for flere
oplysninger!</A></font></td></tr></table></center></div>')
MsgBox.document.write('<script Language="JavaScript">window.status=("Antal
'+loopCount+' fundet")</'+'script'+'>');
}
}
if(!Found)
MsgBox.document.write('<font face="Verdana,Arial,Helvetica" size="2"
clor="#FF0000">Desværre, ingen match fundet.. </font>')
MsgBox.document.write('<font face="Verdana,Arial,Helvetica" size="2"
color="#0F219B"><p align="center"><HR>All rights reserved.</p></font>')
MsgBox.document.write('<style><!--A:link{color: #0000ff;
text-decoration:none} A:visited {color: #0000ff;
text-decoration:none}--></style>')
if(loopCount==0){
MsgBox.document.write('<script Language="JavaScript">window.status=("Ingen
fundet")</'+'script'+'>');
}
}
Torben Roslund
http://www.roslund.dk