PDA

View Full Version : Rss News Ticker!! Help ME!! Please



hicricket
05-29-2007, 01:07 PM
This Script is working in my computer but when i am uploading it , then it is not working please help me and tell me whats wrong with this script.ThankYou



<html>
<head>
<script type="text/javascript">
var sText = ""
var i=0
var iNews=0
var rss = new ActiveXObject("Microsoft.XMLDOM")
rss.async = false
rss.load("http://rss.news.yahoo.com/rss/world")

function GetNewsSource(){
var itemNodes = rss.selectNodes("/rss/channel/item")
var iMax = itemNodes.length

sText = itemNodes.item(iNews).getElementsByTagName("title").item(0).text
myTicker.href = itemNodes.item(iNews).getElementsByTagName("link").item(0).text
ticker()
iNews+=1
if(iNews==iMax){
iNews=0
}
window.setTimeout("GetNewsSource()", (90*sText.length +4000))
}

function ticker(){
i+=1
myTicker.innerText = sText.substring(0,i) + "*"
if(i<sText.length){
window.setTimeout("ticker()",90)
}
else{
i=0
}
}
</script>
</head>
<body onLoad="GetNewsSource()">
<p><b>Yahoo! News: <a id="myTicker" href=""></a></b></p>
</body>
</html>