Jump to content
Tundra

Convert Element Into Image

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? :)

Share this post


Link to post
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\" />");

Share this post


Link to post
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\" />");

Thanks for the code. I'll try it out.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...