![]() |
svg-elements in xml via XHR, putting a single element as an inline code to html5
Code below. 20 svg-elements within a XML-document got from a server via asynchrounous XMLHttpRequest, put into the table svgs (svgs.length == 20, OK). I'd like to put one randomly selected svg-element from the table to html5-page as a inline code. So I think I would need to have single svg -element as a string, which could be inserted to the html5-page. How to do this? And yes, I know that with innerHTML or with jQuery's .load()-method, but what I should the give as a parameter?
Code:
function showImage() { |
On a hunch, I wonder if a problem exists when your code attempts to access elements by tagname from a returned text-stream that has not yet been deserialized into nodes.
|
there is no command to get the source of XML nodes. (they are killing XMLSerializer soon)
you MIGHT be able to simply grab the node and append it to your HTML element. you might need to use importNode depending on the strictness in use. otherwise maybe a temp div will work? Code:
var d=document.createElement("div")Code:
var d=document.createElement("div") |
| All times are GMT +1. The time now is 01:40 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.