I would like to replace an image element of SVG tag. I want that every call to an object which holds the image in controller.js, I will take this image and represent this image as a blur background image by SVG in different file called default.js.
How should I do it?
default.html :
<div id="backgroundImage">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="myGaussianBlur" x="0" y="0">
<feGaussianBlur in="SourceGraphic" stdDeviation="2"></feGaussianBlur>
</filter>
</defs>
<image id="backImage" xlink:href="surf.jpg" width="100%" height="100%" preserveAspectRatio="none" filter="url(#myGaussianBlur)" />
</svg>
</div>
I would like to replace the image in image id ="backImage"
in other image.
Controller.js:
function setObject(element, value) {
var id = value.id;
var image = value.image;
????
}