Forum Moderators: open
I have a simple Javascript that takes some words and at the ; between the words splits the content and makes them links. Problem is the word undefined is printed onscreen after the last link and I don't why?
Help appreciated.
<script type="text/javascript">
var meta = 'test1;test2;test3;test4;test5';
meta = meta.split(';');
// loop through our values
for (i=0;i<=meta.length;i++) {
document.write('<a href="http://www.google.com/search?&q='+meta[
i]+'">'+meta[i]+'</a> ');
}</script>