In the above example, we are making a get request to the XML feed URL for the blog and copying the result to the
this.data variable. Unfortunately, it then throws a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource.” error. We could fix this by tweaking the settings on the server but there is another way. Recently, I came across a project called CORS Anywhere that acts as a reverse proxy and adds CORS headers to the proxied request. So, let’s see what it looks like with CORS Anywhere proxying the request.
Right now, we are just getting the XML content and dumping it onto the page. So, now how do we get the values out?
Grabbing values out of this is more difficult than with JSON but thanks to getElementsByTagName(), it’s not too bad.