Jquery: Running AJAX locally without a webserver

When you run your index.html from a file the AJAX works. But the problem occurs because you are viewing the file at address “file://……/index.html” and you are making a AJAX request to “http://localhost/…./something.php” which IS NOT ALLOWED because of cross site scripting. All AJAX requests must go to the same domain/server.

This is a assuming that you are viewing the file by double clicking it and still making the AJAX request to the web server.

Leave a Comment