Hi there
I am new here and wanted to ask question
I have this simple code to put elements into an array
<html>
<body>
<script type="text/javascript">
var numb =2;
var tempstr="-26.18101|-26.161011|";
var latstr=new Array(tempstr.split("|"));
document.write((latstr[0]) + "<br />");
document.write((latstr[1]) + "<br />");
document.write((latstr[2]) + "<br />");
</script>
</body>
</html>
What it is returning is
-26.18101,-26.161011,
undefined
undefined
Where as I would want and expect
-26.18101
-26.161011
undefined
Any ideas please!!!
Thanks