Hello,
In addition to checking readyState you should also check the status. It should be 200 if call is successful. In FireFox aptana preview you will receive status 0 for some reason and if you want to get response from your PHP server, you may have to set response header manually.
Code:
if(ajaxrequest.readyState == 4)
if (ajaxrequest.status == 200) {
writelog("ajax response got");
}else{
//NB! without allownetwork access in plist a status 0 is returned with text OK!!
writelog("ajax retrieval error: " + ajaxrequest.status+ " "+ ajaxrequest.statusText);
}
}
Hope these help! 
-Ilkka