I’m trying to write a javascript application that loads data from the openstreetmap API (http://wiki.openstreetmap.org/wiki/OSM_Protocol_Version_0.6), which is basically just a restful xml api. I’m trying to use jquery to access the XMl. however I get security errors. This is a cross site scripting blocking.
How can I access that XML? AFAIK OSM don’t offer jsonp, so that doesn’t work. Is there anyway?>
The blog post linked by Dan shows you how to solve this problem, but here’s the background:
The only way you can make a cross-domain Javascript call from a web page is via JSONP. If you aren’t offered JSONP, then you will have to resort to using a Proxy script, as browsers purposefully prevent site scripts from making such calls.
Note that if you’re writing a Firefox extension you are executing in a privileged space, and thus are able to make such cross-domain calls without restrictions.