Difference between revisions of "JSONp"

From BC$ MobileTV Wiki
Jump to: navigation, search
Line 29: Line 29:
 
=== Flickr ===
 
=== Flickr ===
  
* '''Flickr image widget (via JSONp): http://bcmoney-mobiletv.com/metaweb/flickr/'''
+
* '''Flickr image widget (via JSONp): http://bcmoney-mobiletv.com/widgets/flickr/'''
 
* Flickr AJAX API integration (photo/photoset search): http://kylerush.net/javascript/tutorial-flickr-api-javascript-jquery-ajax-json-build-detailed-photo-wall/
 
* Flickr AJAX API integration (photo/photoset search): http://kylerush.net/javascript/tutorial-flickr-api-javascript-jquery-ajax-json-build-detailed-photo-wall/
  
Line 45: Line 45:
 
=== Twitter ===
 
=== Twitter ===
  
* '''Twitter real-time messaging widget (via JSONp): http://bcmoney-mobiletv.com/metaweb/twitter/'''
+
* '''Twitter real-time messaging widget (via JSONp): http://bcmoney-mobiletv.com/widgets/twitter/'''
 
* Twitter JSON/JSONP API URL: http://jquery-howto.blogspot.com/2009/04/twitter-jsonjsonp-api-url.html
 
* Twitter JSON/JSONP API URL: http://jquery-howto.blogspot.com/2009/04/twitter-jsonjsonp-api-url.html
 
* Creating a live Twitter status update with YQL and JavaScript: http://www.bukisa.com/articles/206910_creating-a-live-twitter-status-update-with-yql-and-javascript
 
* Creating a live Twitter status update with YQL and JavaScript: http://www.bukisa.com/articles/206910_creating-a-live-twitter-status-update-with-yql-and-javascript
Line 52: Line 52:
 
=== Facebook ===
 
=== Facebook ===
  
* '''Facebook social networking widget (via JSONp): http://bcmoney-mobiletv.com/metaweb/facebook/'''
+
* '''Facebook social networking widget (via JSONp): http://bcmoney-mobiletv.com/widgets/facebook/'''
 
* JavaScript SDK: http://developers.facebook.com/docs/reference/javascript/
 
* JavaScript SDK: http://developers.facebook.com/docs/reference/javascript/
 
* Graph Api & Javascript Base Facebook Connect Tutorial: http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/
 
* Graph Api & Javascript Base Facebook Connect Tutorial: http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/
Line 61: Line 61:
 
=== Yahoo ===
 
=== Yahoo ===
  
* '''Yahoo! Term Extractor widget: http://bcmoney-mobiletv.com/metaweb/yahoo/'''
+
* '''Yahoo! Term Extractor widget: http://bcmoney-mobiletv.com/widgets/yahoo/'''
 
* Yahoo! web-wide proxy content scraper widget (via YQL and JSONp):  
 
* Yahoo! web-wide proxy content scraper widget (via YQL and JSONp):  
 
* Using YQL with JSONP: http://james.padolsey.com/javascript/using-yql-with-jsonp/
 
* Using YQL with JSONP: http://james.padolsey.com/javascript/using-yql-with-jsonp/
Line 70: Line 70:
 
=== Google ===
 
=== Google ===
  
* '''Google web search widget (via JSONp): http://bcmoney-mobiletv.com/metaweb/google/'''
+
* '''Google web search widget (via JSONp): http://bcmoney-mobiletv.com/google/'''
 
* Google Search AJAX API: http://code.google.com/apis/ajaxsearch/
 
* Google Search AJAX API: http://code.google.com/apis/ajaxsearch/
 
* Google Feed API — Now with instant gratification: http://googleajaxsearchapi.blogspot.com/2010/05/google-feed-api-now-with-instant.html
 
* Google Feed API — Now with instant gratification: http://googleajaxsearchapi.blogspot.com/2010/05/google-feed-api-now-with-instant.html
Line 78: Line 78:
 
=== Wikipedia ===
 
=== Wikipedia ===
  
* '''Wikipedia encyclopedia article search widget (via YUI + JSONp): http://bcmoney-mobiletv.com/metaweb/wikipedia/'''
+
* '''Wikipedia encyclopedia article search widget (via YUI + JSONp): http://bcmoney-mobiletv.com/widgets/wikipedia/'''
 
* MediaWiki API docs: http://en.wikipedia.org/w/api.php
 
* MediaWiki API docs: http://en.wikipedia.org/w/api.php
  

Revision as of 07:59, 21 April 2011

JSON with Padding (commonly abbreviated JSONP) is a JSON extension wherein a prefix is specified as an input argument of the call itself. This padding prefix is typically the name of a callback function, but may also be a variable assignment, an if statement, or any other Javascript statement prefix. The original proposition appears to have been made in the MacPython blog in 2005 [17] and is now used by many Web 2.0 applications such as Dojo Toolkit Applications, Google Toolkit Applications[18] and Web Services. Further extensions of this protocol have been proposed by considering additional input arguments as, for example, is the case of JSONPP[1] supported by S3DB web services.

Because JSONP makes use of script tags, calls are essentially open to the world. For that reason, JSONP may be inappropriate to carry sensitive data.[20]

Including script tags from remote sites allows the remote sites to inject any content into a website. If the remote sites have vulnerabilities that allow JavaScript injection, the original site can also be affected.[2]


Examples

BC$ MobileTV

oEmbed - JSON endpoint:

http://bcmoney-mobiletv.com/1744/oembed/json

oEmbed - special JSONp endpoint (direct):

http://bcmoney-mobiletv.com/api/oembed/oembed_writer.php?v=1744&format=json&callback=displayResults


YouTube


Flickr


Last.fm


Twitter


Facebook


Yahoo

[7][8][9][10]


Google


Wikipedia


Tools

  • JSONPify - a simple way to access feeds and web services from a client based web application: http://jsonpify.com/

Tutorials


External Links


References

  1. Almeida, Jonas (June 11, 2008). "JSON, JSONP, JSONPP?". S3DB: http://sites.google.com/a/s3db.org/s3db/documentation/mis/json-jsonp-jsonpp. Retrieved April 26, 2009.
  2. wikipedia: JSONP#JSONP
  3. Facebook Connect JavaScript SDK: http://github.com/facebook/connect-js
  4. Facebook JavaScript Client Library: http://wiki.developers.facebook.com/index.php/JavaScript_Client_Library
  5. Old JavaScript SDK: http://developers.facebook.com/docs/reference/oldjavascript/
  6. Building a Better Photo Uploader (with JSONp): http://www.facebook.com/note.php?note_id=178492968919
  7. Cross-domain communications with JSONP, Part 1 -- Combine JSONP and jQuery to quickly build powerful mashups: http://www.ibm.com/developerworks/web/library/wa-aj-jsonp1/index.html
  8. Cross-domain communications with JSONP, Part 2 -- Building mashups with JSONP, jQuery, and Yahoo! Query Language: http://www.ibm.com/developerworks/web/library/wa-aj-jsonp2/index.html
  9. YQL and JSONP-X (aka. json-p-x, jsonpx, json-px): http://paul.donnelly.org/2009/07/08/yql-and-jsonp-x/
  10. Mashups with JSONP, jQuery and YQL: http://projects.ischool.washington.edu/tabrooks/343INFOAutumn09/JSONP/jsonpJqueryYQL.htm


See Also

JSON | AJAX | jQuery | JavaScript | XSS