Suche im Forum:
Suchen


Autor Nachricht
Beitrag03.05.2009 um 11:03 (UTC)    
Titel: [erledigt] Zufallslink-Script doppelt verwenden

Hallo,
ich habe ein Zufallslink-Script im Internet gefunden und abgeändert, allerdings möchte ich zwei unterschiedliche Zufallslinks, doch bei beiden Links wird immer die untere Liste verwendet. Weiß jemand Rat?
Code:
<font face="Times New Roman" color="#0000ff" size="3">Du kannst dich nicht entscheiden? Dann hilft dir vielleicht das Zufallsprinzip.<br />
<br />
<br />
<script type=text/javascript>
//Link-Liste
linkliste = new Array( "http://zabrah.de.tl/",
"http://zabrah.de.tl/K.oe.rper-und-Glaube.htm",
"http://zabrah.de.tl/Die-Elemente.htm",
"http://zabrah.de.tl/Geist-und-Seele.htm",
"http://zabrah.de.tl/Magische-Symbole.htm",
"http://zabrah.de.tl/Energie.htm",
"http://zabrah.de.tl/Zauberkraft.htm",
"http://zabrah.de.tl/Dimensionen.htm",
"http://zabrah.de.tl/Nanowelten.htm",
"http://zabrah.de.tl/Leben-und-Tod.htm",
"http://zabrah.de.tl/Illusion.htm",
"http://zabrah.de.tl/Elemente.htm",
"http://zabrah.de.tl/Element-Zwiespalt.htm",
"http://zabrah.de.tl/Element-Wasser.htm",
"http://zabrah.de.tl/Element-Erde.htm",
"http://zabrah.de.tl/Element-Feuer.htm",
"http://zabrah.de.tl/Element-Luft.htm"
);
// zufalls-link
function randomlinkopener1() {
a = Math.round(((linkliste.length-1)*Math.random()));
window.open(linkliste[a],"self");
}
</script> <font color="#993300"><a href="javascript:randomlinkopener1()" target="_self">Zufallsthema</a></font>
<br />
<br />
<script type=text/javascript>
//Link-Liste
linkliste = new Array( "http://zabrah.de.tl/",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Lost.htm",
"http://zabrah.de.tl/Nightwish-_-Amaranth.htm",
"http://zabrah.de.tl/Nightwish-_-Bye-Bye-Beautiful.htm",
"http://zabrah.de.tl/Edenbridge-_-The-Grand-Design.htm",
"http://zabrah.de.tl/Edenbridge-_-The-Palace.htm",
"http://zabrah.de.tl/Nightwish-_-The-Islander.htm",
"http://zabrah.de.tl/Tarja-_-Sing-for-Me.htm",
"http://zabrah.de.tl/Tarja-_-My-Little-Phoenix.htm",
"http://zabrah.de.tl/Nightwish-_-Tutankhamen.htm",
"http://zabrah.de.tl/Nightwish-_-Elvenpath.htm",
"http://zabrah.de.tl/Edenbridge-_-Sunrise-in-Eden.htm",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Flow-this-Desert.htm",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Eclipse.htm",
"http://zabrah.de.tl/Nightwish-_-The-Siren.htm",
"http://zabrah.de.tl/Nightwish-_-Planet-Hell.htm",
"http://zabrah.de.tl/Nightwish-_-7-Days-to-the-Wolves.htm",
"http://zabrah.de.tl/Nightwish-_-Phantom-of-the-Opera.htm",
"http://zabrah.de.tl/Nightwish-_-Over-the-Hills-and-Far-Away.htm",
"http://zabrah.de.tl/Nightwish-_-Dark-Chest-of-Wonders.htm",
"http://zabrah.de.tl/Nightwish-_-Devil-and-the-Deep-Dark-Ocean.htm",
"http://zabrah.de.tl/Edenbridge-_-Undying-Devotion.htm",
"http://zabrah.de.tl/Edenbridge-_-My-Earth-Dream.htm",
"http://zabrah.de.tl/Evanescence-_-Bring-me-to-Life.htm",
"http://zabrah.de.tl/Evanescence-_-Weight-of-the-World.htm",
"http://zabrah.de.tl/Evanescence-_-Going-Under.htm",
"http://zabrah.de.tl/Evanescence-_-Whisper.htm",
"http://zabrah.de.tl/Edenbrige-_-Move-Along-Home.htm",
"http://zabrah.de.tl/Thunderstorm--k1-virtual-surround-k2-.htm",
"http://zabrah.de.tl/Friseur--k1-virtual-surround-k2-.htm",
"http://zabrah.de.tl/Haunted-Forest.htm"
);
// zufalls-link
function randomlinkopener2() {
a = Math.round(((linkliste.length-1)*Math.random()));
window.open(linkliste[a],"self");
}
</script> <font color="#993300"><a href="javascript:randomlinkopener2()" target="_self">Zufallsvideo</a></font></font>

Außerdem funktioniert das Formatieren des Links noch schlechter als sowieso schon im Editor.
______________
Aktualisierungen werden vorrübergehend eingestellt. Aufgrund meines Umzugs, bin ich spätestens wieder Anfang 2010 konstant online.

Aktuell findet auf Zabrah.de.tl ein Poesie-Wettbewerb statt. Mehr Infos
->HIER<- bisherige Teilnamen: 1
Wenn sich nicht bald jemand anmeldet, wird der Wettberwerb aufgelöst!



Zuletzt bearbeitet von zabrah am 03.05.2009, 20:02, insgesamt 3-mal bearbeitet
Beitrag03.05.2009 um 11:29 (UTC)    
Titel:

du musst praktisch alle namen und variabeln umbenennen - dann geht das
Zitat:
<font face="Times New Roman" color="#0000ff" size="3">Du kannst dich nicht entscheiden? Dann hilft dir vielleicht das Zufallsprinzip.<br />
<br />
<br />
<script type=text/javascript>
//Link-Liste
linkliste = new Array( "http://zabrah.de.tl/",
"http://zabrah.de.tl/K.oe.rper-und-Glaube.htm",
"http://zabrah.de.tl/Die-Elemente.htm",
"http://zabrah.de.tl/Geist-und-Seele.htm",
"http://zabrah.de.tl/Magische-Symbole.htm",
"http://zabrah.de.tl/Energie.htm",
"http://zabrah.de.tl/Zauberkraft.htm",
"http://zabrah.de.tl/Dimensionen.htm",
"http://zabrah.de.tl/Nanowelten.htm",
"http://zabrah.de.tl/Leben-und-Tod.htm",
"http://zabrah.de.tl/Illusion.htm",
"http://zabrah.de.tl/Elemente.htm",
"http://zabrah.de.tl/Element-Zwiespalt.htm",
"http://zabrah.de.tl/Element-Wasser.htm",
"http://zabrah.de.tl/Element-Erde.htm",
"http://zabrah.de.tl/Element-Feuer.htm",
"http://zabrah.de.tl/Element-Luft.htm"
);
// zufalls-link
function randomlinkopener1() {
a = Math.round(((linkliste.length-1)*Math.random()));
window.open(linkliste[a],"self");
}
</script> <font color="#993300"><a href="javascript:randomlinkopener1()" target="_self">Zufallsthema</a></font>
<br />
<br />
<script type=text/javascript>
//Link-Liste
linkliste = new Array( "http://zabrah.de.tl/",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Lost.htm",
"http://zabrah.de.tl/Nightwish-_-Amaranth.htm",
"http://zabrah.de.tl/Nightwish-_-Bye-Bye-Beautiful.htm",
"http://zabrah.de.tl/Edenbridge-_-The-Grand-Design.htm",
"http://zabrah.de.tl/Edenbridge-_-The-Palace.htm",
"http://zabrah.de.tl/Nightwish-_-The-Islander.htm",
"http://zabrah.de.tl/Tarja-_-Sing-for-Me.htm",
"http://zabrah.de.tl/Tarja-_-My-Little-Phoenix.htm",
"http://zabrah.de.tl/Nightwish-_-Tutankhamen.htm",
"http://zabrah.de.tl/Nightwish-_-Elvenpath.htm",
"http://zabrah.de.tl/Edenbridge-_-Sunrise-in-Eden.htm",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Flow-this-Desert.htm",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Eclipse.htm",
"http://zabrah.de.tl/Nightwish-_-The-Siren.htm",
"http://zabrah.de.tl/Nightwish-_-Planet-Hell.htm",
"http://zabrah.de.tl/Nightwish-_-7-Days-to-the-Wolves.htm",
"http://zabrah.de.tl/Nightwish-_-Phantom-of-the-Opera.htm",
"http://zabrah.de.tl/Nightwish-_-Over-the-Hills-and-Far-Away.htm",
"http://zabrah.de.tl/Nightwish-_-Dark-Chest-of-Wonders.htm",
"http://zabrah.de.tl/Nightwish-_-Devil-and-the-Deep-Dark-Ocean.htm",
"http://zabrah.de.tl/Edenbridge-_-Undying-Devotion.htm",
"http://zabrah.de.tl/Edenbridge-_-My-Earth-Dream.htm",
"http://zabrah.de.tl/Evanescence-_-Bring-me-to-Life.htm",
"http://zabrah.de.tl/Evanescence-_-Weight-of-the-World.htm",
"http://zabrah.de.tl/Evanescence-_-Going-Under.htm",
"http://zabrah.de.tl/Evanescence-_-Whisper.htm",
"http://zabrah.de.tl/Edenbrige-_-Move-Along-Home.htm",
"http://zabrah.de.tl/Thunderstorm--k1-virtual-surround-k2-.htm",
"http://zabrah.de.tl/Friseur--k1-virtual-surround-k2-.htm",
"http://zabrah.de.tl/Haunted-Forest.htm"
);
// zufalls-link
function randomlinkopener2() {
a = Math.round(((linkliste.length-1)*Math.random()));
window.open(linkliste[a],"self");
}
</script> <font color="#993300"><a href="javascript:randomlinkopener2()" target="_self">Zufallsvideo</a></font></font>
Das blaue muss vom roten unterschiedlich sein, und wie du siehst hast du dort auch zwei mal "linkliste" genommen - also beziehen sich auch beide links auf die ein und die selbe liste, weil sie nicht wissen, welche du nehmen möchtest, nehmen sie die "erstbeste" liste, die sie bekommen...


Zuletzt bearbeitet von gwc am 03.05.2009, 12:31, insgesamt einmal bearbeitet
Beitrag03.05.2009 um 12:03 (UTC)    
Titel:

Es funktioniert! Very Happy

Vielen Dank gwc!


Edit: Inzwischen bekomme ich die Links auch formatiert, aber ein Problem habe ich noch... Egal wo ich überall "self" reinschreibe, immer öffnet der Link einen neuen Tab obwohl er im gleichen Fenster geöffnet werden soll.

So sieht mein Code momentan aus:
Code:
<font face="Times New Roman" color="#0000ff" size="3">Du kannst dich nicht f&uuml;r ein Thema/Video entscheiden? Dann klicke auf einen der folgenden Links.</font><br />
<br />
<script type=text/javascript>
//Link-Liste
linkliste1 = new Array( "http://zabrah.de.tl/",
"http://zabrah.de.tl/K.oe.rper-und-Glaube.htm",
"http://zabrah.de.tl/Die-Elemente.htm",
"http://zabrah.de.tl/Geist-und-Seele.htm",
"http://zabrah.de.tl/Magische-Symbole.htm",
"http://zabrah.de.tl/Energie.htm",
"http://zabrah.de.tl/Zauberkraft.htm",
"http://zabrah.de.tl/Dimensionen.htm",
"http://zabrah.de.tl/Nanowelten.htm",
"http://zabrah.de.tl/Leben-und-Tod.htm",
"http://zabrah.de.tl/Illusion.htm",
"http://zabrah.de.tl/Elemente.htm",
"http://zabrah.de.tl/Element-Zwiespalt.htm",
"http://zabrah.de.tl/Element-Wasser.htm",
"http://zabrah.de.tl/Element-Erde.htm",
"http://zabrah.de.tl/Element-Feuer.htm",
"http://zabrah.de.tl/Element-Luft.htm"
);
// zufalls-link
function randomlinkopener1() {
a = Math.round(((linkliste1.length-1)*Math.random()));
window.open(linkliste1[a],"self");
}
</script> <script type=text/javascript>
//Link-Liste
linkliste2 = new Array( "http://zabrah.de.tl/",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Lost.htm",
"http://zabrah.de.tl/Nightwish-_-Amaranth.htm",
"http://zabrah.de.tl/Nightwish-_-Bye-Bye-Beautiful.htm",
"http://zabrah.de.tl/Edenbridge-_-The-Grand-Design.htm",
"http://zabrah.de.tl/Edenbridge-_-The-Palace.htm",
"http://zabrah.de.tl/Nightwish-_-The-Islander.htm",
"http://zabrah.de.tl/Tarja-_-Sing-for-Me.htm",
"http://zabrah.de.tl/Tarja-_-My-Little-Phoenix.htm",
"http://zabrah.de.tl/Nightwish-_-Tutankhamen.htm",
"http://zabrah.de.tl/Nightwish-_-Elvenpath.htm",
"http://zabrah.de.tl/Edenbridge-_-Sunrise-in-Eden.htm",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Flow-this-Desert.htm",
"http://zabrah.de.tl/Visions-of-Atlantis-_-Eclipse.htm",
"http://zabrah.de.tl/Nightwish-_-The-Siren.htm",
"http://zabrah.de.tl/Nightwish-_-Planet-Hell.htm",
"http://zabrah.de.tl/Nightwish-_-7-Days-to-the-Wolves.htm",
"http://zabrah.de.tl/Nightwish-_-Phantom-of-the-Opera.htm",
"http://zabrah.de.tl/Nightwish-_-Over-the-Hills-and-Far-Away.htm",
"http://zabrah.de.tl/Nightwish-_-Dark-Chest-of-Wonders.htm",
"http://zabrah.de.tl/Nightwish-_-Devil-and-the-Deep-Dark-Ocean.htm",
"http://zabrah.de.tl/Edenbridge-_-Undying-Devotion.htm",
"http://zabrah.de.tl/Edenbridge-_-My-Earth-Dream.htm",
"http://zabrah.de.tl/Evanescence-_-Bring-me-to-Life.htm",
"http://zabrah.de.tl/Evanescence-_-Weight-of-the-World.htm",
"http://zabrah.de.tl/Evanescence-_-Going-Under.htm",
"http://zabrah.de.tl/Evanescence-_-Whisper.htm",
"http://zabrah.de.tl/Edenbrige-_-Move-Along-Home.htm",
"http://zabrah.de.tl/Thunderstorm--k1-virtual-surround-k2-.htm",
"http://zabrah.de.tl/Friseur--k1-virtual-surround-k2-.htm",
"http://zabrah.de.tl/Haunted-Forest.htm"
);
// zufalls-link
function randomlinkopener2() {
a = Math.round(((linkliste2.length-1)*Math.random()));
window.open(linkliste2[a],"self");
}
</script> <a href="javascript:randomlinkopener1()" target="_self"><font color="#993300"><u><strong><font face="Times New Roman" size="3">Zufallsthema</font></strong></u></font></a><br />
<br />
<a href="javascript:randomlinkopener2()" target="_self"><font color="#993300"><u><strong><font face="Times New Roman" size="3">Zufallsvideo</font></strong></u></font></a>

Edit2: Hat sich erledigt. Ich hab rausgefunden, dass ich nicht "self" sondern "_self" schreiben muss.
Nochmals danke gwc!!!
______________
Aktualisierungen werden vorrübergehend eingestellt. Aufgrund meines Umzugs, bin ich spätestens wieder Anfang 2010 konstant online.

Aktuell findet auf Zabrah.de.tl ein Poesie-Wettbewerb statt. Mehr Infos
->HIER<- bisherige Teilnamen: 1
Wenn sich nicht bald jemand anmeldet, wird der Wettberwerb aufgelöst!



Zuletzt bearbeitet von zabrah am 03.05.2009, 20:02, insgesamt 2-mal bearbeitet
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de