So what I have is an SVG-Document with no HTML what-so-ever and in the ...-section I have my JavaScript. In it, there is a function to crea
...
You need to use document.createElementNS('http://www.w3.org/2000/svg', 'path') to create a path element in the SVG namespace.
document.createElementNS('http://www.w3.org/2000/svg', 'path')