Skip Navigation Links



Render "cross-domain" content on the client-side with JSONP feeds & jQuery

Author : Anil      Blog :Tech Tips, Tricks & Trivia      Date: 5/27/2012 5:48:00 PM



When websites provide Feeds of their content, they not only allow that content to be read through Feed readers like Google Reader but also let other sites consume that content programmatically. These feeds can be in various formats like RSS, Atom, JSON, JSONP.

Instead of scraping content from sites they don't own, developers can use RSS, Atom & JSON feeds with server-side programming languages to display that content on their own sites.

JSON stands for JavaScript Object Notation. The advantage with JSON for developers is that it can be directly translated into a JavaScript object. No parsing is necessary to get at the data.

A client-side programming language like JavaScript can however not be used to load a feed if the domain from which the feed is originating is not the same as the site where it is going to be consumed programmatically. That's were JSONP comes in.

The P in JSONP stands for "padding". A JSONP feed is same as a JSON feed except that the feed provider pads the results with a bit more information. JSONP wraps the JSON-formatted response in a function call named by the developer. It allows "cross-domain" feed content to be used via a callback function.

A JSONP feed can be consumed easily using the jQuery ajax() & getJSON() methods.

According to the ProgrammableWeb website, which has been doing a great job of cataloging web-based APIs, there are currently 360 services that offer JSONP feeds. This is good news for jQuery developers.

Related:


Bloggers

active bloggers in the last 24 hrs. Number shown in the bracket represents number of posts published in past 24 hrs,


other authors(76)

Fidarose Isha(3)

N.GURURAJ.(3)

ravi dabas(3)

Ambica Srimal(2)

Deepak(2)

Rakesh HP(2)

Raksha(2)

Sameena Prathap(2)

Srinivasan Sampathkumar(2)

Vashi Chandiramani(2)

Aarthi(1)

Aathira Nair(1)

Anil(1)

Anu Lal(1)

Anu Varma(1)

Anuradha Goyal(1)

Aparna(1)

Aparna(1)

Archana Kumar(1)

aseemrastogi2(1)

Ashwini Kumar(1)

Beyond(1)

Bombay Chowparty(1)

Champa(1)

Chandrika Shubham(1)

churumuri(1)

churumuri(1)

Cynthia Z(1)

Deeps(1)

Devi(1)

Dew(1)

Divya Kudua(1)

Dr.K.P.R.RAJA(1)

Erin W.(1)

Garfield Dsouza(1)

Harimohan(1)

Harini Padmanabhan(1)

harish p i(1)

Hemu(1)

Ibrahim(1)

IS(1)

Iti(1)

Jean(1)

Kaveri Venkatesh(1)

Krithi Karthi(1)

Kunal Singh(1)

Madhavi Madhurakavi(1)

mahima(1)

Manreet Sodhi Someshwar(1)

Meena(1)

Megha Sarin(1)

mêlée(1)

Mohd Salim(1)

MUNZ TDT(1)

Mythreyi(1)

Nagendra Bharathi(1)

Nandana(1)

Neelam Dadhwal(1)

Neeraja(1)

Nisha(1)

Nona(1)

nourishncherish(1)

Nupur(1)

palash ranjan khound(1)

parth joshi(1)

Patricia Torres(1)

pinksocks(1)

Pradeep Chakraborty(1)

Pranshu(1)

Prasanta Bora(1)

Praveen Battula(1)

Priyadarshi Mishra(1)

R.D. Bhalekar(1)

Raafay Awan(1)

Raja(1)

Rams(1)

Ray Titus(1)

rhythmnguitars(1)

Ritesh Agarwal(1)

Ritu(1)

RWABhagidari.blogspot.com(1)

saketvaani(1)

Sameena Prathap(1)

Sampada(1)

Sandhya(1)

Santhosh Sivarajan(1)

Sayantani(1)

sayedkhadri(1)

Shankha(1)

Shankha(1)

Shobha(1)

Shobhaa De(1)

Smi..(1)

Sneo(1)

Sravs(1)

Sree(1)

Sreedhar Jeshurun(1)

Sriram Khé(1)

Sudharsan Narayanan(1)

Sujoy Das(1)

Team G Square(1)

the blogger formerly known as sansmerci(1)

The Guy in the Hat ™(1)

unmanagedexe(1)

Vaishali(1)

vanya(1)

Vasudev Ram(1)

Vikram Karve(1)

vishesh unni raghunathan(1)

VJ Sharma(1)


garland of Languages of India
an amalgamation of the diversified traditions
gracefully presented with novelty
http://www.haaram.com