Jump to content

Convert Element Into Image


Tundra

Recommended Posts

Let me know if you guys are getting tired of me yet...I want to pull the element <rank> from an XML feed and then convert it into an image based on what value the element returns. (01 being private and in the example 12 being major)eg.XML<rank>12</rank>HTMLdocument.write(x.getElementsByTagName("rank")[0].childNodes[0].nodeValue);OUTPUT20px-12.pngThanks in advance!Do I come up with some crazy questions or what? :)

Link to comment
Share on other sites

What about writing a <img /> tag onto the screen?

document.write("<img src=\"http://www.massgate.net/img/ranks/20px-" + x[i].getElementsByTagName("rank")[0].childNodes[0].nodeValue + ".png\" />");

Link to comment
Share on other sites

What about writing a <img /> tag onto the screen?
document.write("<img src=\"http://www.massgate.net/img/ranks/20px-" + x[i].getElementsByTagName("rank")[0].childNodes[0].nodeValue + ".png\" />");

You sir are a f-ing Genius!!!! It worked the first time! I really need help with the rest of my project if you would be so kind to lend your genius again.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...