class SAPO.Communication.Syndication Defined in Communication/Syndication/0.1/lib.js

Constructor Summary
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.

Function Summary
Destroys the current syndication instance
init()
Initialization function. Called by the constructor and receives the same parameters.
Number push (String url, Object options)
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
runAll()
Retrieves the contents for all stored feeds

Constructor Details

constructor Syndication

Syndication()
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.

Function Details

function destroy

destroy()
Destroys the current syndication instance

function init

init()
Initialization function. Called by the constructor and receives the same parameters.

function push

Number push(String url, Object options)
Pushes a feed into an array of feeds which are stored to be run later.
Parameters:
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
Returns:
Identifier of the JSON stream on the array of stored streams

function remove

remove(Number id)
Removes a feed from the array of stored feeds
Parameters:
id - Identifier of the stored feed

function removeAll

removeAll()
Removes all stored feeds

function run

run(Number id)
Retrieves the contents for the feed with the given id and executes the appropriate callbacks
Parameters:
id - feed identifier

function runAll

runAll()
Retrieves the contents for all stored feeds