Difference between revisions of "Widget:Feed"

From COPTR
Jump to navigation Jump to search
Line 3: Line 3:
 
google.load("feeds", "1");
 
google.load("feeds", "1");
 
function initialize() {
 
function initialize() {
var feed = new google.feeds.Feed("");
+
var feed = new google.feeds.Feed("<!--{$url|escape:'urlpathinfo'}-->");
 
feed.load(function(result) {
 
feed.load(function(result) {
 
if (!result.error) {
 
if (!result.error) {

Revision as of 19:33, 12 November 2013

<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("feeds", "1"); function initialize() { var feed = new google.feeds.Feed(""); feed.load(function(result) { if (!result.error) { var container = document.getElementById("feed"); for (var i = 0; i < result.feed.entries.length; i++) { var entry = result.feed.entries[i]; var div = document.createElement("div"); div.appendChild(document.createTextNode(entry.title)); container.appendChild(div); } } }); } google.setOnLoadCallback(initialize); </script>