我知道这是一个愚蠢的问题,但我想问我如何将内容保存到 xmlhttpRequest 内的数组中并在之后使用它们。
onlinestatus = new Array(count);
for (var i = 0; i <= count; i++) {
GM_xmlhttpRequest({
method: 'GET',
url: 'http://www.website.com/player/' + player[i] + '/details.php',
onload: function(responseDetails) {
buddypage = jQuery(responseDetails.responseText);
online = jQuery("span#OnlineStatus", buddypage);
onlinestatus[i] = online.text();
}
});
GM_log("Current: " + onlinestatus[i]);
}