Class TimeMap.loaders.jsonp
- Extends:
- TimeMap.loaders.remote
- Defined in:
- json.js
JSONP loader - expects a service that takes a callback function name as the last URL parameter.
The jsonp loader assumes that the JSON can be loaded from a url with a "?" instead of the callback function name, e.g. "http://www.test.com/getsomejson.php?callback=?". See the jQuery.ajax documentation for more details on how to format the url, especially if the parameter is not called "callback". This works for services like Google Spreadsheets, etc., and accepts remote URLs.
TimeMap.init({ datasets: [ { title: "JSONP Dataset", type: "jsonp", options: { url: "http://www.example.com/getsomejson.php?callback=?" } } ], // etc... });
Constructor
TimeMap.loaders.jsonp(options)
Fields
Field | |
---|---|
opts
:{String}
Object to hold optional settings.
|
|
scrollTo
:{String|Date}
Date to scroll the timeline to on load
|
Methods
Method | |
---|---|
cancel()
Cancel the callback function for this loader.
|
|
getCallback(dataset, callback)
Get a callback function that can be cancelled.
|
|
getCallbackName(dataset, callback)
Get the name of a callback function that can be cancelled.
|
|
load(dataset, callback)
Load function for remote files.
|
|
parse()
Parser function to turn a string into a JavaScript array
|
|
preload()
Function to call on data object before loading
|
|
Function to call on a single item data object before loading
|
Class Detail
TimeMap.loaders.jsonp(options)
Parameters (optional) | ||
---|---|---|
options | {Object} | All options for the loader: |
options.url | {String} | URL of JSON service to load, callback name replaced with "?" |
options[...] | {mixed} | Other options (see loaders.remote) |
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)