|Version 2 (modified by tiago.c.rodrigues, 3 years ago)|
[Elements] are optional
Defined in Communication/Syndication/0.1/lib.js
Inclusion link: http://js.sapo.pt/SAPO/Communication/Syndication/0.1/
This module provides a way to bypass the same origin policy on AJAX requests, allowing you to load JSON content from a different domain by injecting a script tag into your html with a variable which stores that JSON content. Receives the same parameters as the push method.
Destroys the current syndication instance
Initialization function. Called by the constructor and receives the same parameters.
Pushes a feed into an array of feeds which are stored to be run later.
remove (Number id)
Removes a feed from the array of stored feeds
Removes all stored feeds
run (Number id)
Retrieves the contents for the feed with the given id and executes the appropriate callbacks
Retrieves the contents for all stored feeds
Number push(String url, Object options)
url- URI of the JSON file to load
options- Options for the syndication instance
[ function(Object dataObj, Object onCompOpt) onComplete ]- function to be executed when the JSON object is loaded
[ function(onLoadOpt) onLoading ]- function to be executed while the JSON object is loading
[ function(onTimeOpt) onTimeout ]- function to be executed when a timeout occurs.
[ function(onExitOpt) onExit ]- function to be executed after every other action is done
[ Number timeout ]- timeout (in seconds) for the JSON loading. Defaults to 10.
[ Object optOnComplete ]- options to be used with the onComplete callback
[ Object optOnLoading ]- options to be used with the onLoading callback
[ Object optOnTimeout ]- options to be used with the onTimeout callback
[ Object optOnExit ]- options to be used with the onExit callback
[ String objectName ]- name of the variable sent from the server which holds the JSON data
Identifier of the JSON stream on the array of stored streams
id- Identifier of the stored feed
id- feed identifier