I am sticking values into a script, and I am using the function below to 'implode' the array
function implode() { var str='';
for(item in globvars)
str +='\n'+globvars[item]+';';
return str+'\n';
}
Sample usage:
globvars = ['Tom', 'Dick', 'Harry'];
output = '<script type = "text/javascript">\n'+implode(globvars)+'</script\>';
Expected output should be:
<script type = "text/javascript">
Tom
Dick
Harry
</script>
Instead, I am getting something like this:
<script type = "text/javascript">
Tom Dick Harry </script>
what the ... ?