[latex]Mae govannen![/latex]
Dieser Code läuft etwa 4 mal so schnell:
for (j=0 ; j<document.getElementsByTagName("h1").length; j++)
{
for (i=1 ; i<llis; i++ )
{
if (liste[i]==document.getElementsByTagName("h1")[j].firstChild.data)
{
document.writeln("<div id="v-briefeintrag"><a href="../briefe/" + liste[i] + ".htm">" + document.getElementsByTagName("h2")[j].firstChild.data + "</a></div>")
document.writeln("<div id="v-inhalt">" + document.getElementsByTagName("h3")[j].firstChild.data + "</div>")
}
}
}
Was ist mit (ungetestet)
~~~javascript
var h1coll = document.getElementsByTagName("h1"),
h2coll = document.getElementsByTagName("h2"),
h3coll = document.getElementsByTagName("h3"),
hlen = hcoll.length;
for (j=0; j<hlen; j++)
{
for (i=1 ; i<llis; i++ )
{
if (liste[i]==hcoll[j].firstChild.data)
{
document.writeln("<div id=\"v-briefeintrag\"><a href=\"..\/briefe\/" + liste[i] + ".htm\">" + h2coll[j].firstChild.data + "<\/a><\/div>")
document.writeln("<div id=\"v-inhalt\">" + h3coll[j].firstChild.data + "<\/div>")
}
}
}
wobei ich document.writeln auch zugunsten der DOM-Methoden vermeiden würde.
Stur lächeln und winken, Männer!
Kai
--
It all began when I went on a tour, hoping to find some furniture
Followed a sign saying "Beautiful Chest", led to a lady who showed me her best)
SelfHTML-Forum-Stylesheet
It all began when I went on a tour, hoping to find some furniture
Followed a sign saying "Beautiful Chest", led to a lady who showed me her best)
SelfHTML-Forum-Stylesheet