не могу прочитать отдельные элементы внутри SVG файла, что не так?
test.svg
<?xml version="1.0" encoding="utf-8"?>
<svg id="root" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<ellipse id="n1" cx="50" cy="60" rx="20" ry="20" />
<ellipse id="n2" cx="150" cy="60" rx="25" ry="25" />
<ellipse id="n3" cx="250" cy="60" rx="35" ry="35" />
</svg>
test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style type="text/css"></style>
</head>
<body>
<embed id="svg" type="image/svg+xml" src="test.svg" pluginspage="http://www.adobe.com/svg/viewer install/" />
</body>
<script type="text/javascript">
//<object id="root" data="test.svg" type="image/svg+xml"></object>
window.addEventListener("load", on_load);
function on_load ()
{
// console.log(document.getElementById('svg').getSVGD ocument());
// null
// console.log(document.getElementById('svg').svg);
// undefined
// console.log(document.getElementById('svg').content Document);
// undefined
// но!
// console.log(document.getElementById('svg'));
// test.html:25 <embed id="svg" type="image/svg+xml" src="test.svg" pluginspage="http://
www.adobe.com/svg/viewer install/">#document<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="root" version="1.1"><ellipse id="n1" cx="50" cy="60" rx="20" ry="20"></ellipse><ellipse id="n2" cx="150" cy="60" rx="25" ry="25"></ellipse><ellipse id="n3" cx="250" cy="60" rx="35" ry="35"></ellipse></svg></embed>
console.log(document.getElementById('svg').getElem entById('root'));
// test.html:37 Uncaught TypeError: document.getElementById(...).getElementById is not a function
}
</script
</html>