Jump to content
Sending a XML Request
Asked by LindaBB
Posted Dec 10 2010 08:14 AM
Hope someone can help me, feel pretty foolish messing up with a book-example
Number of downloads: 500
Answered by Robin Nixon
Posted Dec 10 2010 10:13 AM
Ajax communication between a web page and a web server suffers from very tight security restrictions. Data from the server will be accepted by the web page only if the page was loaded from the server.
Therefore the only way to properly test any Ajax code is to upload both the Web page and the PHP files to a web server (a local development server is not likely to work dues to useing localhost:// and a local file system), and test them from there.
In your example these are both one and the same file, but it must still be on a server with a domain.
I hope this helps.
Comment by LindaBB : Dec 10 2010 01:15 PM
Thanks a lot, Robin, I won't waste any more time on my localhost.