Wednesday, August 11, 2010

JSONP (JSON with Padding) In Action

Cross-site scripting: a cookie that should be ...Image via Wikipedia
I just read a great article in Dr Dobbs about JSONP In Action. The article discusses the issue of cross-site scripting in browsers, and how sometimes we need to be able to do it. It is simply not just for hackers.

It is interesting that the src attribute in a <script> tag is side can be changed on the e fly. This opens a number of opportunities. The article demonstrates one way using jQuery to update a result based on jQuery.getJSON(url).

I will need to explore this functionality in a little more detail since I have been exploring the possibilities of MongoDB. This would allow a page to be updated from information contained on servers which are not local, and to display data from multiple sources.
Enhanced by Zemanta

0 comments :

Popular Posts