Javascript Json和AJAX

I am working on javascript & Json & Ajax but i have few question in my mind that json file can work without localhost ? and secondly about ajax can we use ajax with json on locally our hard disk not at localhost?

Ajax is a method for requesting files via HTTP. You can only use Ajax to request files on the same server, because of the Same-Origin-Policy (https://de.wikipedia.org/wiki/Same-Origin-Policy). So no, if your server is on localhost, you have to request the files on localhost. You cannot access the local file system. You can upload your files though, and then request them using Ajax.

If you're not using a web server then there is nowhere for the the AJAX request to be sent. AJAX needs the web server to communicate with in order for it to be able to retrieve any data.

Without using a web server you are viewing a file at address "file://...some path.../filename.html". In this scenario sending an AJAX request to another domain is not allowed because of cross site scripting.