I\'m developing a JavaScript class to show all SVG objects, but when I create the element \"image\", the browser doesn\'t display it. Though if I copy the generated code and put
The problem were the namespaces. This is the correct form to create images dynamically:
image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'flower.png');
More imformation can be found on MDN's 'Namespaces Crash Course'.