Hi,
If you watch this news feed the £ on the fourth item shows up as a ?, is there any way to fix this?
http://dev.switchedonmedia.com/news/news.aspHere is the code ...
<%@ Language="VBScript" %>
<% Option Explicit %>
<% Response.Charset = "UTF-8" %>
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>AMA Intranet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.heading {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #31009C;
}
.body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
}
a.heading:link {color: #31009C;}
a.heading:visited {color: #31009C;}
a.heading:hover {color: #31009C; text-decoration: none;}
a.heading:active {color: #31009C;}
-->
</style></head>
<body>
<%
If DateDiff("h", Application("BBCNEWS"), Now()) >= 2 _
Or Request.QueryString("force
") <> "" Then
Dim objXML
Dim objItemList
Dim objItem
Dim strHTML
Set objXML = Server.CreateObject("MSXML
2.FreeThre
adedDOMDoc
ument")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load("
http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/in_depth/business/mortgages/rss.xml")
'objXML.Load(Server.MapPat
h("rss.xml
"))
If objXML.parseError.errorCod
e <> 0 Then
Response.Write "<pre>" & vbCrLf
Response.Write "<strong>Error:</strong> " & objXML.parseError.reason
Response.Write "<strong>Line:</strong> " & objXML.parseError.line & vbCrLf
Response.Write "<strong>Text:</strong> " _
& Server.HTMLEncode(objXML.p
arseError.
srcText) & vbCrLf
Response.Write "</pre>" & vbCrLf
End If
Set objItemList = objXML.getElementsByTagNam
e("item")
Set objXML = Nothing
%>
<script type="text/javascript">
//configure the below five variables to change the style of the scroller
var scrollerdelay='3000' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='200px'
var scrollerheight='105px'
var scrollerbgcolor='#F2EFFA'
//set below to '' if you don't wish to use a background image
var scrollerbackground=''
//configure the below variable to change the contents of the scroller
var messages=new Array()
<%
dim count
count = 0
For Each objItem In objItemList
strHTML = strHTML & "messages[" & count & "]=""<span class='heading'><a href='" & objItem.childNodes(2).text
& "' target='_blank'><strong>" & Replace(objItem.childNodes
(0).text, """", "'") & "</strong></a></span><span
class='body'><br>" & Replace(objItem.childNodes
(1).text, """", "'") & "</span>""" & vbCrLf
count = count + 1
Next
Set objItemList = Nothing
Application.Lock
Application("AMAContent") = strHTML
Application("AMAUpdated") = Now()
Application.UnLock
End If
%>
<%= Application("AMAContent") %>
///////Do not edit pass this line//////////////////////
/
var ie=document.all
var dom=document.getElementByI
d
if (messages.length>2)
i=2
else
i=0
function move(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>
0&&parseIn
t(tdiv.sty
le.top)<=5
){
tdiv.style.top=0+"px"
setTimeout("move(tdiv)",sc
rollerdela
y)
setTimeout("move2(second2_
obj)",scro
llerdelay)
return
}
if (parseInt(tdiv.style.top)>
=tdiv.offs
etHeight*-
1){
tdiv.style.top=parseInt(td
iv.style.t
op)-5+"px"
setTimeout("move(tdiv)",50
)
}
else{
tdiv.style.top=parseInt(sc
rollerheig
ht)+"px"
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move2(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)
>0&&parseI
nt(tdiv2.s
tyle.top)<
=5){
tdiv2.style.top=0+"px"
setTimeout("move2(tdiv2)",
scrollerde
lay)
setTimeout("move(first2_ob
j)",scroll
erdelay)
return
}
if (parseInt(tdiv2.style.top)
>=tdiv2.of
fsetHeight
*-1){
tdiv2.style.top=parseInt(t
div2.style
.top)-5+"p
x"
setTimeout("move2(second2_
obj)",50)
}
else{
tdiv2.style.top=parseInt(s
crollerhei
ght)+"px"
tdiv2.innerHTML=messages[i
]
if (i==messages.length-1)
i=0
else
i++
}
}
function startscroll(){
first2_obj=ie? first2 : document.getElementById("f
irst2")
second2_obj=ie? second2 : document.getElementById("s
econd2")
move(first2_obj)
second2_obj.style.top=scro
llerheight
second2_obj.style.visibili
ty='visibl
e'
}
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;w
idth:'+scr
ollerwidth
+';height:
'+scroller
height+';o
verflow:hi
dden;backg
round-colo
r:'+scroll
erbgcolor+
' ;background-image:url('+sc
rollerback
ground+')"
>')
document.writeln('<div style="position:absolute;w
idth:'+scr
ollerwidth
+';height:
'+scroller
height+';c
lip:rect(0
'+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;w
idth:'+scr
ollerwidth
+';left:0p
x;top:1px;
">')
document.write(messages[0]
)
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;w
idth:'+scr
ollerwidth
+';left:0p
x;top:0px;
visibility
:hidden">'
)
document.write(messages[dy
ndetermine
=(messages
.length==1
)? 0 : 1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
if (window.addEventListener)
window.addEventListener("l
oad", startscroll, false)
else if (window.attachEvent)
window.attachEvent("onload
", startscroll)
else if (ie||dom)
window.onload=startscroll
</script>
</body>
</html>