I replaced the URL 'ajax_info.txt' by a website URL (http://...) which responds with some text. The resulting code works in IE 8.
Why is the code not working for Chrome (no responseText)?
What is the solution (without using any library)?
Thank you for your time.
P.S: I am very new to web development.
If you new and you want to avoid most of cross javascripting issues go for jQquery
which lightweight and have less problems when there is no of browser involved
for you current issue you can go for jQuery .Ajax() method will resolve your issue
Browsers have a security limitation called 'same origin policy.' It prevents random websites from making requests on your behalf using your identity information stored in the browser via cookies or localStorage. For example if w3schools.com could make an AJAX request to facebook.com it could find out where you lived or who your friends are if you have that information on Facebook. Browsers prevent this kind of a request by only allowing AJAX requests to make requests to the domain, port and protocol (http or https for example) that the document originated from.
More information:
http://en.wikipedia.org/wiki/Same_origin_policy
This is why your request did not work in Chrome, assuming you put some random site's URL in place of the text file. I am not sure why it would have worked for IE 8. I doubt it would.
Using JQuery will make you code much easier to manage so go for it. If you really don't want to use library have a look on this www.w3.org/TR/XMLHttpRequeste
Then about the code in the link you provided. I'm able to execute it without any error in chrome. Do the ajax request in your chrome browser did not encounter any error. Try to use the chrome developer tools, here you will see the response status sent by the server. Also you can see if there's an error on your js code.