I’m using xml to populate a html site (so the flash site can be ported automatically for those without flash).
for (i=0;i<x.length;i++)
{
// VARS //
//Set up Vars for <li> elements
var src = x[i].getElementsByTagName("image")[0].childNodes[0].nodeValue;
// IMG //
//If 'name' node is present, append 'name' to #filmsfuturereleases
if (x[i].getElementsByTagName("image")[0].childNodes.length) {
document.write('<img src="', src, '"/>');
} else {
document.write(" ")
}
}
In the code I set the ‘src’ variable and then use a loop to write each image.
I’d like to get rid of the document.write functions and replace with something like append, so I could put the image into a list.
I can do this when I’m using text (append text var to an li element), but since I’m dynamically adding the image AND the image src, I’m having trouble.
Any ideas? jQuery can be used, xslt cannot…
Cheers!
try something like that