Jump to content
self_learning

Change text with AJAX

Recommended Posts

I read topic about Ajax at W3School. I made firstAjax.html. I attached it. Then I create ajax_info.txt from where I want to receive data and print on html page. But code not work.

 

Please help!

 

 

firstAjax.html

ajax_info.txt

Share this post


Link to post
Share on other sites

What exactly isn't working? Worked when I tried it. The two files need to be in the same folder.

Share this post


Link to post
Share on other sites

Dear Faal, yes these files are in same folder. When I click on button, nothing happened. There is no changing in webpage.

Share this post


Link to post
Share on other sites

Many browsers prevent AJAX requests from HTML files on the local filesystem for security reasons. Firefox normally works, so you can use Firefox for testing on the filesystem. Otherwise you will need to set up a server on your computer to run it.

  • Like 1

Share this post


Link to post
Share on other sites

Many browsers prevent AJAX requests from HTML files on the local filesystem for security reasons. Firefox normally works, so you can use Firefox for testing on the filesystem. Otherwise you will need to set up a server on your computer to run it.

I think this is your answer. I used FireFox to test it and it worked fine. Didn't test in any other browsers though.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×