View Single Post
Old 05-07-2009, 09:26 PM   PM User | #5
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
store your timeout into a variable
Code:
ticktock = window.setTimeout("TICKER_tick()", 30);
and you need to cancel it when you get the Ajax call back
Code:
if(xmlHttp.readyState == 4){
  var response = xmlHttp.responseText;
  TICKER.innerHTML = response;
  setTimeout('callServer()',5000);
  TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
  TICKER_RIGHTTOLEFT = false;
  TICKER_SPEED = 2;
  TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
  TICKER_PAUSED = false;
  window.clearTimeout(ticktock);
  ticker_start(); 
}
Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote