I have been trying to create a SIMPLE javascript slide show that gets the info from an XML. Being that I am a newbie I have looked at dozens of site and have not found anything that I can use or understand. I put a few things together from different sites but it is still not working. Here is my code
JS
//specify interval between slide (in mili seconds)
var slidespeed=2000
//specify images
var slideimage=new Array("images/pic1.jpg","images/pic2.jpg","images/pic3.jpg");
//specify corresponding links
var slidelinks=new Array("#1","#2","3");
var imageholder=new Array()
var ie55=window.createPopup
function loadXMLDoc(url)
{
var xmlhttp;
var txt,xx,x,i;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
xml=xmlhttp.responseXML.documentElement.getElementsByTagName("site");
for (i=0;i<xml.length;i++)
{
slideimage=xml*.getElementsByTagName("imageURL")[0].firstChild.nodeValue;
links=xml*.getElementsByTagName("url")[0].firstChild.nodeValue;
{
try
{
txt=txt+'<span><a href="' + links +'"><img src="' + slideimage + '" name="slide" border=0 style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=1)"></a></span>';
}
catch (er)
{
txt= "<span> </span>";
}
}
}
document.getElementById('affiliates').innerHTML=txt;
}
}
xmlhttp.open("GET",url,true);
xmlhttp.send();
}
loadXMLDoc('affiliates.xml');
for (i=0;i<slideimage.length;i++){
imageholder*=new Image();
imageholder*.src=slideimage*;
}
function gotoshow(){
window.location=slidelinks[whichlink]
}
Code on page
<script language="JavaScript1.1">
<!--
var whichlink=0
var whichimage=0
var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie55) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie55) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+pixeldelay)
}
slideit()
//-->
</script>
Please help