I am trying to code a greasemonkey script. But I think there is a
problem with my xmlhttpRequest function.I am new at this
xmlhttpRequest thing and I can't find the problem. When I load the
page nothing happens. So I put those Control 1,2 etc alerts to find
out where the problem is. Now when I load the page first alert Control
1 pops up but the second one doesn't. So probably the problem is about
the xmlhttpRequest function. So I need your help guys.. :/


    var e3, linkk, id, url, txt, hasta;

    linkk = location.href;
    id =  linkk.charAt(79) + linkk.charAt(80) + linkk.charAt(81) +
linkk.charAt(82) +  linkk.charAt(83) + linkk.charAt(84) +
linkk.charAt(85);
    hasta = 0;


    alldivs = document.getElementsByTagName('div');

    e3 = alldivs[4].getElementsByTagName('table')
[0].getElementsByTagName('tr')[5];

    alert('Control 1');

    ( function (e3) {
    GM_xmlhttpRequest({
    method: 'GET',
    url: 'http://beta.xxxxxxxxxxx.com/World/xxxxxxxxx.aspx/Character/
Diary/' + id,
    onload: function onloadCallback(responseDetails) {
    var txt= responseDetails.responseText;

    var kontrol1 = txt.indexOf('coming down with something');
var kontrol2 = txt.indexOf('Flu is wearing');
var kontrol3 = txt.indexOf('Rabies is wearing');
var kontrol4 = txt.indexOf('Chlamydia is wearing');
var kontrol5 = txt.indexOf('that it is Rabies');
var kontrol6 = txt.indexOf('that it is Chlamydia');
var kontrol7 = txt.indexOf('that it is Flu');
    var kontrol8 = txt.indexOf('that it is Chicken Pox');
var kontrol8 = txt.indexOf('that it is Zombie Virus');
var kontrol9 = txt.indexOf('Chicken Pox is wearing');
var kontrol10 = txt.indexOf('Zombie Virus is wearing');

if (kontrol1 == '-1')
{
    hasta = 1;
}

if (kontrol2 == '-1')
{
    hasta = 1;
}

if (kontrol3 == '-1')
{
    hasta = 1;
}

if (kontrol4 == '-1')
{
    hasta = 1;
}

if (kontrol5 == '-1')
{
     hasta = 1;
}

if (kontrol6 == '-1')
{
    hasta = 1;
}

if (kontrol7 == '-1')
{
    hasta = 1;
}

if (kontrol8 == '-1')
{
    hasta = 1;
}

if (kontrol9 == '-1')
{
    hasta = 1;
}

if (kontrol10 == '-1')
{
    hasta = 1;
}
alert('control 2')
    if (hasta== 1)
    {
    var mesaj=  '<strong><font color="red">HASTA!</font></strong>';
    }
    else
    {
    var mesaj=  'Sağlıklı';
    }

    var yeni = document.createElement("font");
    yeni.innerHTML = '<tr valign=top><td width=20 valign=bottom><img
width=20     height=16 title=Hasta></td><td width=170>' + mesaj + '</
td></tr>';
e3.parentNode.insertBefore(yeni, e3);
alert(yeni);
    }
    } );


})(e3);

-- 
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.

Reply via email to