From the course: Ajax with PHP: Add Dynamic Content to Websites

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Load remote JSON

Load remote JSON

From the course: Ajax with PHP: Add Dynamic Content to Websites

Start my 1-month free trial

Load remote JSON

- [Instructor] Since the creation of Ajax, JSON has become a more popular way to transfer structured data than by using XML. In large part this is because JSON is ready for use inside our Java Script code. While XML requires navigating XML structure, which can be cumbersome. To demonstrate how to use JSON, we could simply send JSON back from a static file. Just like we sent back text in the last movie. However, there are many excellent third party APIs which return JSON, and I think it's useful for us to try to use one of those instead. So let's try an example which uses the popular Google Maps API. You can see that I've added a new directory to my sites directory called Ajax_zipcode and has one file in it called index.html. This will be in your exercise files if you have access to those, but it's also a very simple file that you could write yourself. Inside text editor, we'll take a look. We see that we have a basic HTML page. Has a little bit of style information up here. Mostly…

Contents