title: Convert inline SVG to Base64 string
body: <p>I want to send an inline SVG image to a PHP script to Convert it to PNG with Imagick. For that I have to know how to get a base64 String out on an inline SVG. For canvas objects its a simple ".toDataURL()" but that doesn't work with inline SVGs, because its not a global function of elements.</p>
  
  <pre><code>test = function(){
      var b64 = document.getElementById("svg").toDataURL();
      alert(b64);
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/nikolang/ccx195qj/1/">http://jsfiddle.net/nikolang/ccx195qj/1/</a></p>
  
  <p>But how to do it for inline SVGs?</p>