Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (i = 0; i < length; i++) {
- (function(i) {
- // new XMLHttpRequest
- xhr[i] = new XMLHttpRequest();
- // gets machine url from href tag
- url = rows[i].getElementsByTagName("td")[0].getElementsByTagName('a')[0].getAttribute('href');
- //Insert the desired values at the end of each row; will try to make this customizable later as well
- insertVNC[i] = rows[i].insertCell(-1);
- insertSerial[i] = rows[i].insertCell(-1);
- insertVersion[i] = rows[i].insertCell(-1);
- insertFreeDiskSpace[i] = rows[i].insertCell(-1);
- // the fun part: this function takes each url, loads it in the background, retrieves the values needed, and then discards the page once the function is complete; In theory you could add whatever you want without taking significantly longer as long as it's on this page
- console.log(i);
- xhr[i].onreadystatechange = function() {
- if (xhr[i].readyState == 4 && xhr[i].status == 200) {
- }
- };
- //"Get" the "Url"... true means asyncrhonous
- console.log(url);
- xhr[i].open("GET",url,true);
- xhr[i].send(null);
- }) (i); //end for loop
- }
Add Comment
Please, Sign In to add comment