Syndication How to

SAPO.Communication.Syndication is a module which 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.

The server response will have to be be something like:

var random_var_name = { "json_content": ... };

The random variable name is generated client side and passed through a jsonTag url parameter.

Loading one feed only:

<script type="text/javascript"> 
new SAPO.Communication.Syndication(<json_uri>, {<options>}); 
</script>

If you want to load more than one feed, create an object instance and store the feeds with the push method:

var instanceOfSyndication = new SAPO.Communication.Syndication(); 
var myid = instanceOfSyndication->push(<json_uri>, {<options>});

Run a specific feed:

instanceOfSyndication->run(feed_id);

Run all feeds:

instanceOfSyndication->runAll();

Remove feeds:

instanceOfSyndication->remove(feed_id);
instanceOfSyndication->removeAll();

Destroy the object instance:

instanceOfSyndication->destroy();