I've been looking all over, and I can't find a clean solution (that I can make sense of).
How can I pull an entry at random from an xml list?
My starting point is as follows (which pulls the latest entry):
<script type="text/javascript">
var xmlDoc=null;
if (window.ActiveXObject)
{// code for IE
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
if (xmlDoc!=null)
{
xmlDoc.async=false;xmlDoc.load("/folder/file.xml");
var x=xmlDoc.getElementsByTagName("z:row");
for (i=0;i<1;i++)
{
document.write(x[i].getElementsByTagName("@ows_Title")[0]
.childNodes[0].nodeValue);
}
}
</script>
Any and all suggestions greatly welcomed!