I have the following code:
var s=Stop;5,Service;13,Error;21,LINK DOWN;53,Data Incomplete;2,Replication Off;0,LINK DOWN;53
I need to loop in and get:
stop 5
Service 13
Error 21
.
.
I need to use an array because I have to get the value of stop service to show it on my html.
I have tried this:
var rslt = [];
for (var i = 0; i < 5; i++) {
rslt[i] = s.substr(i, s.indexOf(','));
}
But it does not give me what I want.