This is working fine in firefox at least.
The problem I was facing is, that I got an XML object in stead of a plain text string. Reading an xml-file from my local drive works fine (same directory as the html), so I do not see why reading a text file would be an issue.
I figured that I need to tell jquery to pass a string in stead of an XML object. Which is what I did, and it finally worked:
function readFiles()
{
$.get('file.txt', function(data) {
alert(data);
}, "text");
}
Note the addition of '"text"' at the end. This tells jquery to pass the contents of 'file.txt' as a string in stead of an XML object. The alert box will show the contents of the text file. If you remove the '"text"' at the end, the alert box will say 'XML object'.