I need to insert a DOM which is a complete SVG document into an <object>
element. SO here's my code:
var svgDom = (new DOMParser()).parseFromString(streamedFile,'image/svg+xml');
var pagePics = document.querySelectorAll('#currentFiles figure object');
for (var i=0; i<pagePics.length; i++){
pagePics[i].contentDocument = svgDom.document;
}
But this doesn't work. DOM inspector doesn't show <object>
's contentDocument property after this code has run.
It's possible to use jQuery if this makes things easier. What am i doing wrong?