I have a question about Google Feed. It helps me to display RSS by using javascript. First I want to show the code, then I'm going to ask my question.
JS Part:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script language="javascript">
var sglm=new Array();
sglm[0]= 'ahmet tanakol';
google.load("feeds", "1");
function initialize() {
var feed = new google.feeds.Feed("http://www.ntvmsnbc.com/id/24927681/device/rss/rss.xml");
feed.setNumEntries(6);
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);
Body:
<body onload="startbcscroll();" bgcolor="#ffffcc" text="navy"><center>
<div id="feed"></div>
Ok, I'm using this Google Feed code and another js to display messages in a horizontal scrolling. Both of them are working now, but I want to display RSS feed in this horizontal scrolling. When I run the code, first it displays titles of Rss feeds, then at the bottom there is a horizontal scrolling. In this horizontal scrolling, it takes values from an array called "sglm". You can see it in JS Part. For example it has to be exactly in this format othersiw it won't work;
sglm[0] = 'Hello World'
Now I want to put titles from RSS feeds into this array in this format. I couldn't figure it out, so maybe you can help me. By the way,it puts Rss feeds titles into a div with id feed. Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…