I have this function:
function sendCommand(id, ip, command) {
var xmlhttp = makeRequestObject();
var file = 'http://example.com/ajaxaccessdata.php?ip=';
xmlhttp.open('GET', file + ip + '&command=' + command, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var content = xmlhttp.responseText;
if (content) {
document.getElementById('result' + id).value = content;
}
}
}
xmlhttp.send(null)
}
And i have n textarea with IDs 'result1', 'result2', ..., 'resultn'
.
And when i call function sendCommand
my function put result in all textarea, so result for sendCommand(1, 'localhost', 'A')
will be put in all textarea not only in result
.
Any ideas ?
Thanks