Now that we have the data and know generally how to create markers with that data, we need to look at how to bridge a JavaScript call in Google Maps to a server call in Flickr Services. Flickr Services has a REST-based endpoint available. This means that all we would need to do is send a GET
or POST
request to the endpoint, supplying our parameters, and we would get data back. Moreover, one return option is JavaScript Object Notation, JSON. Theoretically, we can use the XMLHttpRequest
object in JavaScript to send a GET
request, and get JavaScript directly back from the server. We can then use this JavaScript to dynamically change our page. This would really make things easy.
The main obstacle to this is that we cannot make the XMLHttpRequest GET/POST
request directly against Flickr Services. This is because cross-scripting attacks are a security problem. To counter this, all web browsers prevent a site from sending an XMLHttpRequest
against another...