jsonp

A simple JSONP implementation

  • Owner: webmodules/jsonp
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

jsonp

A simple JSONP implementation.

saucelabs

Installation

Install for node.js or browserify using npm:

$ npm install jsonp

Install for component(1) using component:

$ component install LearnBoost/jsonp

Install for browser using bower:

$ bower install jsonp

API

jsonp(url, opts, fn)

  • url (String) url to fetch
  • opts (Object), optional
    • param (String) name of the query string parameter to specify
      the callback (defaults to callback)
    • timeout (Number) how long after a timeout error is emitted. 0 to
      disable (defaults to 60000)
    • prefix (String) prefix for the global callback functions that
      handle jsonp responses (defaults to __jp)
    • name (String) name of the global callback functions that
      handle jsonp responses (defaults to prefix + incremented counter)
  • fn callback

The callback is called with err, data parameters.

If it times out, the err will be an Error object whose message is
Timeout.

Returns a function that, when called, will cancel the in-progress jsonp request
(fn won't be called).

License

MIT

Main metrics

Overview
Name With Ownerwebmodules/jsonp
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:
所有者活动
Created At2012-07-04 00:16:38
Pushed At2024-04-08 14:08:00
Last Commit At2016-10-31 10:21:53
Release Count7
Last Release Name0.2.1 (Posted on 2016-10-31 10:21:53)
First Release Name0.0.1 (Posted on )
用户参与
Stargazers Count1.9k
Watchers Count52
Fork Count330
Commits Count56
Has Issues Enabled
Issues Count37
Issue Open Count26
Pull Requests Count12
Pull Requests Open Count4
Pull Requests Close Count10
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private