It is important to know that AJAX, currently, is a terrible cross-domain solution for anything (such as reading files or posting data).
If you are trying to read a file from http://somewebsite/data.txt but the AJAX script is running from http://yoursite.com/ the AJAX will fail. The only exception to this is when a server specifically sets up cross-domain rules that will allow things like AJAX request to send or receive data. However if you don't control the site where this text file is located, then you are at the mercy of whoever does control the server. This also applies to running AJAX from your local computer (as ShrineDesigns mentioned), as your computer's domain/address does not match the domain where the file is located.
That being said, in the event this text file is on your server and you are trying to read it from your server, then I would need to see your code to tell you why it doesn't work.