API Docs for:
Show:

gallery-jsonp Module

Provides a JSONPRequest class for repeated JSONP calls, and a convenience method Y.jsonp(url, callback) to instantiate and send a JSONP request.

The callback for the response can be named in the url explicitly or provided in the configuration (second parameter to the constructor).

By default, the query parameter string "callback=???" will be searched for in the url (??? can be anything). If it's not found, it will be added on. If the JSONP service uses a different parameter name or url format, you can override this behavior with the format property in the callback config.

The second parameter can be a callback function that accepts the JSON payload as its argument, or a configuration object supporting the keys:

  • on - map of callback subscribers
    • success - function handler for successful transmission
    • failure - function handler for failed transmission
    • timeout - function handler for transactions that timeout
  • format - override function for inserting the proxy name in the url
  • timeout - the number of milliseconds to wait before giving up
  • context - becomes this in the callbacks
  • args - array of subsequent parameters to pass to the callbacks

This module provides the following classes: