Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Super Tiny JSONP Library
branch: master

Merge pull request #2 from carvefx/master

Request Params as JSON data
latest commit 2ab32bf0cb
Adrian Mihai carvefx authored

JSONP Beta 1.0

Alpha Stage


This is a super tiny JSONP library for when you don't need jQuery or another JS library just for JSONP requests.


After searching for "JSONP examples" and "JSONP tutorials" I was dissapointed by the lack of straightforward JSONP stuff out there. While there is nothing wrong with jQuery and I use it every single day, sometimes you need to do some JSONP without using jQuery and so I wrote this for myself, but feel free to use it! The min version is only 621 bytes.


It's simple. There are three parameters, but you only need two. This is what it looks like:

JSONP([url],[data], [method],[callback])

To get my Twitter avatar for example you'd do:


Sometimes the third-party site require a custom method name, like Flickr, which requires jsoncallback rather than the standard callback method. Here's an example to get a thumbnail of my latest pic on Flickr:


You can also pass parameters in the form of a JSON object, like so:

JSONP('',{'since': '2014-02-01T12:00:00Z'},function(json){
  document.getElementById('github').innerHTML =[0].html_url;

Browser Support

  • IE6+
  • Firefox 3.0+
  • Safari 4.0+
  • Google Chrome 14.0+
  • Opera 10.6+

To do...

  • Anything else people request, if anything
Something went wrong with that request. Please try again.