I have 2 files named index.html and mytext.txt in the same folder. I want to get contents of mytext.txt using an ajax call in the index.html. I use this code but it is only working in firefox not chrome:
$.ajax({
url: "mytext.txt",
dataType: 'text',
success: function(data) {
alert(data);
}
});
I am opening index.html simply from explorer not server!
file://protocol is not allowed with ajax calls. It needs to be on a webserver, even if that webserver ishttp://localhost