I have a simple ajax query working perfectly in other environment
(complete file named adv1.php):
remark: this is NOT cross-domain, as answered in many questions on this site!
<?PHP
if($_GET['uin']=='1') {
sleep(10);
echo 4711;
exit;
}
?>
<html><head><title>ajax</title></head><body>
<script type='text/javascript'>
ajax=new XMLHttpRequest();
ajax.open('GET', 'adv1.php?uin=1', true);
ajax.send(null);
ajax.onreadystatechange=showres;
alert('request sent');
function showres() {
if(ajax.readyState==4){
alert('ajax says: ' + ajax.responseText + 'status:' + ajax.status);
}
}
</script>
</body></html>
so when I run the code, I expect a waiting time of 10 secs (sleep...) and afterwards the responsetext 4711. what I get instead is: "ajax says: status:0" on the otherf hand, when i enter the url http://path/to/my/file/adv.php?uin=1 I get the correct answer.
i have copied and adapted this script from another script on my site. the other script works perfectly...
the script doesnt throw any console-error...
any help? thx in advance!