Problem with accessing an array in javascript

I want to build a web-remote for the DAW Reaper, using Reapers WebRC.

How it works in basic you can read about here:

In my case I want to access the markers set in Reaper.

The minimum example of the code I use you find here:

<!doctype html>
<html>
<head>

<script src="main.js"></script>
<script type="text/javascript">
function wwr_onreply(results) {
  var ar = results.split("n");

  for (var i = 0; i < ar.length; i++) {
    var tok = ar[i].split("t");
    if (tok.length > 0)
      switch (tok[0]) {
        case "MARKER":
          document.getElementById("marker").innerHTML = tok;
          break;
      }
  }
}

wwr_req_recur("MARKER", 1000);
wwr_start();
</script>
</head>

<body>

<p>tok of "MARKER": <div id="marker"></div></p>

</body>

</html>

So Reaper passes the queried in a single line of text.
Each parameter (e.g. “TRANSPORT”, “TRACKS”, “MARKERS”, etc.) is divided by “n”.
If a parameter contains multiple parameters (like different markers), they are divided by “t”.

Now the results get split by “n” and stored in the array “ar”.
After that, if containing multiples, they get split by “t” and stored in the array “tok”.

My problem: I can only access the last marker in the “tok”.
The tok.length is always ‘5’ (Marker, Marker name, id, position, color), no matter how many markers are in the project.
When I use “alert(tok.length);”, the message windows opens and by clicking ok I can step through all the markers.

Can anyone help me, how I can access the other entries in “tok”?

I tried like with nested array (tok[2][3];), but it didn’t help…

I tried to display “tok” with document.getElementById("element").innerHTML = tok and document.getElementById("element").innerHTML = tok[x][y]

I tried to display via “alert(tok)”