I have an image gallery that uses javascript and xml. But I don’t know how to write the XML file. I’ve written to the creator, but gotten no response. I’ve looked on the web and through this website, but I’m not knowledgable enough to make any use of it.
Could someone help me write the XML file?
I think this is the code snippet you need, but let me know if you need the whole file.
/* ---- parse xml ---- */
var bank = AJAX(xmlfile).responseXML.getElementsByTagName("bank").item(0).getElementsByTagName("img");
this.NF = bank.length;
for (var i = 0; i < this.NF; i++) {
var img = bank.item(i);
var val = function (tag) {
var t = img.getElementsByTagName(tag);
return (t.length && t[0].firstChild) ? t[0].firstChild.nodeValue : '';
}
/* ---- create images ---- */
this.diapos[i] = new Diapo(this, i, val("src"), val("title"), val("caption"), val("link"), val("target") || '_self');
}