In recent days to learn Ajax, want to test the Ajax sample, because before the server leased in Ali expired, and then want to let the local host server and do the client, just simple test, should be OK.
So, download the xampp, download the URL http://www.apachefriends.org, only need to unzip the installation of a fool to be able to.
Locate the directory where the software is installed, click Xampp-control.exe and then launch the Apache service, open the browser, enter localhost in the address bar, appear as a tablet, indicating that the installation started is no problem
Now write two simple text, a TXT file, an HTML code:
As follows:
TXT text:
HTML file:
Put these two files in the xampp/htdoc/directory, double-click the HTML file, under Chrome and IE, respectively, the following error appears:
The general meaning is that AJAX requests access to server data across domains failed or was denied access, I looked up the internet, and saw a lot of ways to add the boot parameters to chrome, such as--disable-web-security. But not all the same, and the experience is not very good, and then directly in the address bar input localhost/1.html Two kinds of browsers are displayed as follows:
There is a more concise way to open directly with Firefox, but also to achieve the purpose
Local host as a server to resolve Ajax cross-domain request access to data