无法访问服务器上的文件

Sorry for this basic question am a bit confused now.

I am learning javascript and mounted a page on the 00webhost site to play around and do all the tests. So far it works fine but am stuck following this tutorial AJAX

I created a txt file and uploaded to the server; have tried copying it on the same path as the javascript, giving full path, at the public root, all I get is the 404 server response.

I noticed that browsing to that file on my navigator(chrome), send a message saying "Failed to open". I guess this is a problem with accessing the resource on the server, if that is so... am not sure how to configure it. Giving it the 777 file permission didn't make any difference.

This is done in a shared server on a free hosting service, do you think I have restrictions configuring this?

From the index.html I use this button with id "btnAjax" to later bind the event on the javascript file

...
<div id="ajax">
 <input type="button" id="btnAjax" value="Testing AJAX" onclick="getText('ajaxretrieve.txt')"/>
</div>
<script type="text/javascript" src="jsdir/ajax.js">

</script>
....

As for the javascript (ajax.js) here is how the button is bound to the server response var myRequest;

function getText(url)
{

    if(window.XMLHttpRequest)
{
     myRequest = new XMLHttpRequest();

}
else
{
       myRequest = new ActiveXObject("Microsoft.XMLHTTP");
}


myRequest.open("GET", url, true);
myRequest.send(null); // nothing to send
myRequest.onreadystatechange = getData;

}

// handles the server response
function getData()
{
    var myBtn = document.getElementById("btnAjax");

if(myRequest.readyState === 4)
{
        alert(myRequest.status);
        if(myRequest.status === 200)
    {

          var text = myRequest.responseText;

          myBtn.nodeValue = text;
    }
}
} 

From the code above I can get the alert on the browser, am printing there the status with the value of 404. I couldn't never get the success status of 200.

.txt files are restricted in 000webhost for security reasons.

Source: http://www.000webhost.com/forum/web-design-html/18175-cannot-read-text-any-text-files.html

Try renaming to html or htm and see if that works.