I’ve came across this code on the vbulletin forums probably a year or two ago and everything has been working great however I would like to change the output a bit. Right now the script will output the entire thread title on my home page (html page).
What I’d like to know from any of your javascript programmers, is there a way to limit the thread title length? Say instead of the entire thread title maybe only show the first 15 characters?
<script type="text/javascript" src="http://www.domain.com/forum/external.php?type=js"></script>
<script type="text/javascript">
<!--
for (x = 0; x < 8; x++)
{
document.writeln("<li><a href=\\"http://www.domain.com/forum/showthread.php?t="+threads[x].threadid+"\\" title=\\""+threads[x].title+"\\">"+threads[x].title+"</a></li>");
}
//-->
</script>