Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
RSS Feed 'Sticks' on timeout

Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
New one
New one

Joined: 09 Oct 2008
Posts: 1

PostPosted: Thu Oct 09, 2008 10:14 am    Post subject: RSS Feed 'Sticks' on timeout Reply with quote


First of all I'm far from a javascript/ajax/html expert so go easy.

I've been given the code below to get an RSS feed and dynamically update it on an html page, (currently set to every 10 seconds for testing).

What happens most times is that the RSS feeds stops scrolling through items (set to every 1 second, again for testing) after the xmlHttp timeout (10sec).

Occasionally the RSS will continue scrolling through items as desired, but once there is an update to rss.xml, the update will be shown then the feed will stick.

Any suggestions or changes to code would be appreciated.


window.onload = init;

var xmlHttp
var x = 2;

function init(){

setTimeout("updateView()", 2000);


function getXML()
if (xmlHttp==null)
alert ("Your browser does not support AJAX!");
var url="rss.xml";

function updateView(){
var temp = xmlHttp.responseXML.documentElement;
var y = temp.getElementsByTagName("title")[x].childNodes[0].nodeValue;
var truncateDescription = temp.getElementsByTagName("description")[x-1].childNodes[0].nodeValue;
if(truncateDescription.length > 170){
truncateDescription = truncateDescription.substr(0, 170);
truncateDescription = truncateDescription.concat("...");
var date = temp.getElementsByTagName("pubDate")[x-2].childNodes[0].nodeValue;



x = x+1;
if(x > 7){
x = 2;


function GetXmlHttpObject()
var xmlHttpReq;
// Firefox, Opera 8.0+, Safari
xmlHttpReq=new XMLHttpRequest();
catch (e)
// Internet Explorer
xmlHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
catch (e)
xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttpReq;


<div style="color:0091b8" id="txthint">Your Items for sale</div>
<div style="color:gray;font-size=60%" id="txthint3">Will be listed here</div>
<div style="font-size=85%; color:black" id="txthint2">Spell things correctly</div>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 XML & Copyright Notice 

Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X

Link to our site:


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos

Normal Bookmark

Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax

Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?

it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert