I'm using the svgcanvas.js to create SVG and trying to save the svgcode.
With the normal canvas content, I could save the resulting png as below: toDataURL and with window.location.href the save as Dialog appeared in my Browser.
With the SVG, the SVG appears in the URL. How can I make the Browser save the SVG-Code as File?
var ctx = new CanvasSVG( "#SVG" );
ctx.beginPath();
ctx.fillStyle = "#333333";
ctx.fillRect( 10 , 10 , 50 , 50 );
ctx.closePath();
document.getElementById( "xml" ).innerHTML = ctx.toDataURL( "image/svg+xml" );
var image=ctx.toDataURL( "image/svg+xml" );
window.location.href=image;