<a href='data:application/xml;charset=utf-8,your code here' download='filename.html'>Save</a>
saveAs()
function won't send pure string to the browser, you need to convert it to blob
:saveAs
on the blob, as like:<script src=FileSaver.js>
saveAs
function: https://github.com/koffsyrup/FileSaver.js