I have an array mapped to list grid and the response from my server needs to be tweaked before being displayed. For example: a status code of 2 means that the server is up and status code of 9 means its off.
I so far have used this code:
code
$('#startScreen_statusLabel').each(function() {
var text = $(this).text();
$(this).text(text.replace('9', 'Offline'));
});
$('#startScreen_statusLabel').each(function() {
var text = $(this).text();
$(this).text(text.replace('2', 'Online'));
});
$('#startScreen_statusLabel').each(function() {
var text = $(this).text();
$(this).text(text.replace('4', 'Paused'));
});/code
but its not really working for more than the first instance, I want it to replace all the instances of that number in that specific label. Also, if I wanted the background of the "startScreen_mobilelistitem_64" div to change based on the status is that possible?