AJAX vs JSONP

Tom Scavo trscavo at gmail.com
Sun Oct 23 22:23:23 BST 2011


We have a process that converts XML metadata into JSON format and a
couple of client-side web applications (HTML, CSS, and JavaScript)
that fetch static JSON metadata via AJAX. The browser's same origin
policy is making the deployment, uh, interesting, so the thought is to
abandon AJAX in favor of JSONP so that the JSON files can be served
from a central server. I realize there are concerns with JSONP
generally, but in this case, are there security issues or other
problems that we should be aware of?

Ultimately we want to distribute code that fetches static metadata via
JSONP and exposes it to web applications via a JavaScript API. The
initial use case is federated error handling but most any
browser-based UI could leverage metadata in this way, I suppose. Is
this a viable approach to building browser-based interfaces? Would you
use it?

Thanks,
Tom


More information about the dev mailing list