WoodiE
02-12-2009, 02:28 PM
I'm using the following code to display the latest threads in my footer, however I'd like to limit the number of characters that are shown in the Thread title.
Can anyone show me what needs to be changed to say limit it to the first 20 or so characters?
<script type="text/javascript" src="http://www.mydomain.com/external.php?type=js"></script>
<script type="text/javascript">
<!--
for (var i = 0; i < threads.length; i++)
{
document.write('<li><a href="http://www.mydomain.com/showthread.php?t=' + threads[i]['threadid'] + '" title="' + threads[i]['title'] + '">' + threads[i]['title'] + '</a></li>');
}
//-->
</script>
Thanks!
Can anyone show me what needs to be changed to say limit it to the first 20 or so characters?
<script type="text/javascript" src="http://www.mydomain.com/external.php?type=js"></script>
<script type="text/javascript">
<!--
for (var i = 0; i < threads.length; i++)
{
document.write('<li><a href="http://www.mydomain.com/showthread.php?t=' + threads[i]['threadid'] + '" title="' + threads[i]['title'] + '">' + threads[i]['title'] + '</a></li>');
}
//-->
</script>
Thanks!