Workshop 7: Using AJAX and parsing XML and JSON

Back to landing page

output


AJAX stands for Active JavaScript with XML and basically means a way to request a script to fetch data from a file or an API and return it back to the script. Then we can utilize the data either by injecting it into the page as such or by first parsing the data (using loops) and then format the data the way we like. Chrome Developer Tools offer nice way of tracking AJAX calls as well. Press F12 to open the tools and click Network-tab. Here you are able to see the requests and responses in action.

NOTE: Ajax calls will cause security issues in many cases. If you encounter those, I recommend to sign up for a free account in Codeanywehere.com and do these exercises there. Copy this exercise-file there and start doing the exercises.

If you get "Blocked loading mixed active content" error, please check whether you're using http or https for your http requests. More info on this in https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content