Tundra Posted February 20, 2008 Share Posted February 20, 2008 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);OUTPUTThanks in advance!Do I come up with some crazy questions or what? Link to comment Share on other sites More sharing options...
Synook Posted February 22, 2008 Share Posted February 22, 2008 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 More sharing options...
Tundra Posted February 22, 2008 Author Share Posted February 22, 2008 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\" />"); Thanks for the code. I'll try it out. Link to comment Share on other sites More sharing options...
Tundra Posted February 22, 2008 Author Share Posted February 22, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.