I use the gm_setvalue function in a for loop. it works properly on the
first loop but not working after that..
var e = document.getElementById('Menu1');
alldivs = e.getElementsByTagName('div');
var e3, link, uzunluk, id, sira, server, number;
for (ii=0;ii<=5;ii++)
{
e3 = alldivs[ii].getElementsByTagName('a')[1];
link = e3.href;
uzunluk = link.length;
id = '';
for (i=66;i<=uzunluk;i++)
{
sira = link.charAt(i);
id= id + sira;
}
server = '12' + link.charAt(12);
GM_xmlhttpRequest({
method: 'GET',
url: 'http://www' + server + '.XXXXXXX.com/Common/Locale.asp?
action=ViewCharacters&LocaleID=' + id,
onload: function(responseDetails) {
var txt= responseDetails.responseText;
var yer = txt.indexOf('lan ');
if (yer> 0)
{
var sayn = '' + txt.charAt(yer+7) + txt.charAt(yer+8);
GM_setValue("store", sayn);
alert(sayn);
}
if (yer== '-1')
{
if (txt.indexOf(' kimse') == '-1')
{
var sayn = '1';
alert(sayn);
GM_setValue("store", sayn);
}
else
{
var sayn = 'Bos';
alert(sayn);
GM_setValue("store", sayn);
}
}
}
});
number = GM_getValue("store","error");
GM_deleteValue("store");
var yeni = document.createElement("font");
yeni.innerHTML = '<font color="red">(' + number +')</a>';
e3.parentNode.insertBefore(yeni, e3);
}
GM_getValue("store","error"); takes the value on the first loop, but
on the next ones it gives out "error". So the values are empty. It
shows that there is a problem with the GM_setValue function. It only
works on first loop.. What shall I do, Have any idea?
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.