Nie jesteś zalogowany na forum.
Poprosił mnie ktoś ostatnio o pomoc jak dodać coś do "Dzisiaj forum odwiedzili" do dymku wyświetlanego po najechaniu na danego użytkownika więc podaje mini-kod, może komuś się przyda.
<script type="text/javascript">
if(document.getElementById("onlinetodaylist"))
{
for (i=0;i<document.getElementById("onlinetodaylist").getElementsByTagName("dd").length;i++)
{
var unikatowy_link = document.getElementById("onlinetodaylist").getElementsByTagName("dd")[i].getElementsByTagName("a")[0].href.split("=")[1];
var tytul_poprzedni= document.getElementById("onlinetodaylist").getElementsByTagName("dd")[i].getElementsByTagName("a")[0].title;
document.getElementById("onlinetodaylist").getElementsByTagName("dd")[i].getElementsByTagName("a")[0].title="Jest to "+unikatowy_link+" heros na Ziemii. \n"+tytul_poprzedni;
}
}
</script>
Wiadomość dodana po 20 h 28 min 48 s:
Poprawiony kod, nie generuje błędu jeżeli forum nikt nie odwiedził.
<script type="text/javascript">
if(document.getElementById("onlinetodaylist").getElementsByTagName("dd")[0].getElementsByTagName("a")[0])
{
for (i=0;i<document.getElementById("onlinetodaylist").getElementsByTagName("dd").length;i++)
{
var unikatowy_link = document.getElementById("onlinetodaylist").getElementsByTagName("dd")[i].getElementsByTagName("a")[0].href.split("=")[1];
var tytul_poprzedni= document.getElementById("onlinetodaylist").getElementsByTagName("dd")[i].getElementsByTagName("a")[0].title;
document.getElementById("onlinetodaylist").getElementsByTagName("dd")[i].getElementsByTagName("a")[0].title="Jest to "+unikatowy_link+" heros na Ziemii. \n"+tytul_poprzedni;
}
}
</script>
Ostatnio edytowany przez ukaszf9 (2014-12-26 11:47:33)
Offline