AJAX not working with XAMPP or is it just impossible
===

I'm still relatively new to AJAX and am trying to figure out why my simple test is not working. From what I read AJAX will not work under one domain, and other words pop up like cross-site and remote server. Anyways my problem is is that I'm not sure if my code is wrong or simply what I'm trying to do is impossible. I created a simple ajax request to submit data when I click on the button. Here is the code for the first script.

    <html>

    <head>

    <script type="text/javascript" >

    function load(thediv, thefile) {

    if (window.XMLHttpRequest) 

    {
	 
    xmlhttp = new XMLHttpRequest();	
	 
    } else 

    {

    xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		
    }	

    xmlhttp.onreadystatechange = function() 
	
    {

    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
		
    {

    document.getElementById(thediv).innerHTML = xmlhttp.responseText;
		
    }		
		
    }
	
    xmlhttp.open('GET', thefile, true);
	
    xmlhttp.send();

    }

    </script>

    </head>

    <body>

    <input type="submit" onclick="load('adiv', 'hello.php');">

    <div id="adiv"></div>

    </body>

    </html>




Here is the code for the file hello.php


    <?php

    echo 'aaa';

    ?>









