Hi
I’m putting together a webpage for downloading a list of project files.
The project file names and status are listed in a seperate XML file. ie:
<CATALOG>
<ISSUE>
<DOCID></DOCID>
<REV></REV>
<TITLE></TITLE>
<PDF></PDF>
</ISSUE>
</CATALOG>
And read in from an html page with a bit of javascript like this: (extract)
for (var i=0;i<x.length;i++)
{ document.write(“<tr>”);
document.write(“<td><h6>”);
document.write(x[i].getElementsByTagName(“DOCID”)[0].childNodes[0].nodeValue);
document.write(“</td>”);
document.write(“<td><h6>”);
document.write(x[i].getElementsByTagName(“REV”)[0].childNodes[0].nodeValue);
document.write(“</td>”);
document.write(“<td><h4>”);
document.write(x[i].getElementsByTagName(“TITLE”)[0].childNodes[0].nodeValue);
document.write(“</td>”);
document.write(x[i].getElementsByTagName(“PDF”)[0].childNodes[0].nodeValue);
document.write(“</td>”);
document.write(“</tr>”);
}
document.write(“</table>”);
}
The <PDF></PDF> holds the file name to download. Currently the PDF file name is displayed but What i’d like to do is to instead of displaying the file name I’d like to show a download icon and make it a hyperlink to the file named in the <PDF></PDF> instead.
I guess I’d have to add what base directory to find the <PDF></PDF> files as well, rather than a full path to each file.
I’m sure this is possible, but how? Any advice would be great.