function ausgabe(hits) mit scrollbalken im PopUp

digiTAL

Erfahrenes Mitglied
Hallo allersiets,

ich habe eine suchmaschine mit javascript realisiert und mein problem besteht
darin, das das PopUp mit scrollbalken dargestellt werden soll das die treffer
anzeigt.

kann mir da jemand helfen?

hier mein script
PHP:
<script language="JavaScript">
<!--
function episode(name, folge, nummer) {
  this.name = name;
  this.folge = folge;
  this.nummer = nummer;
}
var database = new Array();
database[0] = new episode("Das Tor zum Universum (1/2)","S01F01","DVD 01");
database[1] = new episode("Das Tor zum Universum (2/2)","S01F02","DVD 01");
database[2] = new episode("Der Feind in seinem Körper","S01F03","DVD 01")
database[3] = new episode("Verraten und verkauft","S01F04","DVD 01");
database[4] = new episode("Die Seuche","S01F05","DVD 01");
database[5] = new episode("Das erste Gebot","S01F06","DVD 01");
database[6] = new episode("Die Auferstehung","S01F07","DVD 02");
database[7] = new episode("Die Macht der Weisen","S01F08","DVD 02");
database[8] = new episode("Die Auserwählten","S01F09","DVD 02");
database[9] = new episode("Im Reich des Donnergottes","S01F10","DVD 02");
database[10] = new episode("Die Qualen des Tantalus","S01F11","DVD 02");
database[11] = new episode("Blutsbande","S01F12","DVD 02");
database[12] = new episode("Feuer und Wasser","S01F13","DVD 03");
database[13] = new episode("Der Kuß der Göttin","S01F14","DVD 03");
database[14] = new episode("Cassandra","S01F15","DVD 03");
database[15] = new episode("Vergeltung","S01F16","DVD 03");
database[16] = new episode("Enigma","S01F17","DVD 03");
database[17] = new episode("Im ewigen Eis","S01F18","DVD 03");
database[18] = new episode("Übermenschen","S01F19","DVD 04");
database[19] = new episode("Die Invasion (1/3)","S01F20","DVD 04");
database[20] = new episode("Die Invasion (2/3)","S01F21","DVD 04");
database[21] = new episode("Die Invasion (3/3)","S01F22","DVD 04");

function suchen()
{

var eingabe = new RegExp(document.forms[0].elements[0].value,'i');
var hits = new Array();
var j = 0;
for(var i = 0; i < database.length; i++)
    {
    if(carstring(database[ i ]).search(eingabe) > -1)
        {
        hits[j++] = i;
        }
    }
(hits.length>0)?ausgabe(hits):alert('kein Treffer');

}

function carstring(episode) { 
return episode.name+" "+episode.folge+" "+episode.nummer; 
} 
function ausgabe(hits) { 
self.name = "mainwindow"; //setzt Fensternamen 
var win = open('','Treffer','width=500,height=400'); 
with(win.document) { 
write('<html><head>');
write('<link href="css.css" type=text/css rel=Stylesheet>'); 
write('<title>Treffer</title>'); 
write('</head><body>'); 
write('<table>'); 
for(var i = 0; i < hits.length; i++) { 
var episode = database[hits[i]]; 
write('<tr>'); 
write('<td width="250">'+episode.name+'</td>'); 
write('<td width="100">'+episode.folge+'</td>'); 
write('<td width="100">'+episode.nummer+'</td>'); 
} 
write('</table></body></html>'); 
} 
} 
// --> 
</script>
 

Neue Beiträge

Zurück