Should I use
, , or
for loading SVG files into a page in a way similar to loading a
jpg>
and
have an interesting property: they make it possible to obtain a reference to SVG document from outer document (taking same-origin policy into account). The reference can then be used to animate the SVG, change its stylesheets, etc.
Given
You can then do things like
document.getElementById("svg1").addEventListener("load", function() {
var doc = this.getSVGDocument();
var rect = doc.querySelector("rect"); // suppose our image contains a
rect.setAttribute("fill", "green");
});