View Full Version : whats wrong with this code?


xDANiELLEx_xo
11-09-2004, 12:34 AM
ok i put it in the web stats and it wont work. is there something wrong with it?

<script language="javascript">
<!--
var links = document.getElementsByTag Name ('a');
for (var l = 0; l < links.length; l++) {
str = links[l].innerHTML;
if (str.match (/\d+:\d+ (am|pm)/i)) links[l]
else if (str.match (/add comments/i)) links[l].innerHTML = str.replace (/add comments/i, "y0ur th0ughts");
else if (str.match (/add eprops/i)) links[l].innerHTML = str.replace (/add eprops/i, "i l0ve y0u");
else if (str.match (/eprops/i)) links[l].innerHTML = str.replace (/eprops/i, "KiSSES");
else if (str.match (/eprop/i)) links[l].innerHTML = str.replace (/eprop/i, "KiSS");
else if (str.match (/comments/i)) links[l].innerHTML = str.replace (/comments/i, "l0vers");
else if (str.match (/comment/i)) links[l].innerHTML = str.replace (/comment/i, "l0ver");
else if (str.match (/sign out/i)) links[l].innerHTML = str.replace (/sign out/i, "LEAViNG");
else if (str.match (/signin/i)) links[l].innerHTML = str.replace (/signin/i, "C0MiNG iN");else if (str.match (/oldest/i)) links[l].innerHTML = str.replace (/oldest/i, "past");
else if (str.match (/newest/i)) links[l].innerHTML = str.replace (/newest/i, "present");
else if (str.match (/sign my guestbook/i)) links[l].innerHTML = str.replace (/sign my guestbook/i, "my guestb0ok");
else if (str.match (/add comments/i)) links[l].innerHTML = str.replace (/add comments/i, "y0ur th0ughts");
else if (str.match (/add eprops/i)) links[l].innerHTML = str.replace (/add eprops/i, "i l0ve y0u");
else if (str.match (/email it/i)) links[l].innerHTML = str.replace (/email it/i, "EMAiL");
else if (str.match (/Get trial subscription/i)) links[l].innerHTML = str.replace (/Get trial subscription/i, "TRiAL SUBSRiPTiON");
else if (str.match (/subscribe!/i)) links[l].innerHTML = str.replace (/subscribe!/i, "SUBSCRiBE");
else if (str.match (/join/i)) links[l].innerHTML = str.replace (/join/i, "J0iN");


}
//-->
</script>

retardednerd
11-09-2004, 09:49 AM
i don't know what was wrong with it but here's a working one:
<script language="javascript">
<!--
var links = document.getElementsByTagName ('a');
for (var l = 0; l < links.length; l++) {
str = links[l].innerHTML;
if (str.match (/\d+:\d+ (am|pm)/i)) links[l]

else if (str.match (/add comments/i)) links[l].innerHTML = str.replace (/add comments/i, "y0ur th0ughts");
else if (str.match (/add eprops/i)) links[l].innerHTML = str.replace (/add eprops/i, "i l0ve y0u");
else if (str.match (/eprops/i)) links[l].innerHTML = str.replace (/eprops/i, "KiSSES");
else if (str.match (/eprop/i)) links[l].innerHTML = str.replace (/eprop/i, "KiSS");
else if (str.match (/comments/i)) links[l].innerHTML = str.replace (/comments/i, "l0vers");
else if (str.match (/comment/i)) links[l].innerHTML = str.replace (/comment/i, "l0ver");
else if (str.match (/subscribe!/i)) links[l].innerHTML = str.replace (/subscribe!/i, "SUBSCRiBE");
else if (str.match (/sign out/i)) links[l].innerHTML = str.replace (/sign out/i, "LEAViNG");
else if (str.match (/signin/i)) links[l].innerHTML = str.replace (/signin/i, "C0MiNG iN");
else if (str.match (/oldest/i)) links[l].innerHTML = str.replace (/oldest/i, "past");
else if (str.match (/newest/i)) links[l].innerHTML = str.replace (/newest/i, "present");
else if (str.match (/sign my guestbook/i)) links[l].innerHTML = str.replace (/sign my guestbook/i, "my guestb0ok");
else if (str.match (/email it/i)) links[l].innerHTML = str.replace (/email it/i, "EMAiL");
else if (str.match (/Get trial subscription/i)) links[l].innerHTML = str.replace (/Get trial subscription/i, "TRiAL SUBSRiPTiON");
else if (str.match (/join/i)) links[l].innerHTML = str.replace (/join/i, "J0iN");
}//-->
</script>

i hope this helps.

xDANiELLEx_xo
11-11-2004, 08:59 PM
that code didnt work either. but thanks for trying. maybe its just my xanga i dont know.

vanillacokemeeh
11-12-2004, 02:01 AM
Have you tried putting it FIRST in the webstats module? If that still doesn't work, then maybe its your computer, that doesn't allow javascript.

hope that helps.