Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Grab the array of images from the XML document.
- var xmlDoc = xmlhttpobject.responseXML;
- var ListItems = xmlDoc.getElementsByTagName("z:row")||xmlDoc.getElementsByTagNameNS("*","row");
- // Select a random item from the XMl.
- var SelectedItem = Math.floor(Math.random() * ListItems.length);
- // Compile the URL which we'll use for the image.
- PictureURL = "/" + ListItems[SelectedItem].getAttribute("ows_RequiredField");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement