html
<!DOCTYPE html> <html> <body> <a href="data:text/plain;charset=utf-8,'aaaaaaa'" id="aFi-file-download"></a> <script> function file_download(xmlstr, filename) { document.getElementById("aFi-file-download").href = "data:text/plain;charset=utf-8," + xmlstr; document.getElementById("aFi-file-download").download = filename; document.getElementById("aFi-file-download").click(); }; </script> </body> </html>
call
this.Button00_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo) this.Button00_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo){ var xml = '<?xml version="1.0" encoding="UTF-8"?><Sap><resultOtherCode>Y</resultOtherCode><tprtvrtlchtList><tprtvrtlchtVO><sn>BD00120190000004</sn><cmpnyCd>LENC</cmpnyCd><prufDe>20190131</prufDe><chitTyCd>DB</chitTyCd><pstngDe>20190131</pstngDe><crncyCd>KRW</crncyCd><vrtlchtNo>BD00120190000004</vrtlchtNo><hderTextCn>gwweb1/10081/정보시스템팀</hderTextCn><inputerEmpno>20090204</inputerEmpno><inputerDeptCd>10081</inputerDeptCd><moinSanctnNo>PD20094FE0D554016B93FBB89ACAD6C17</moinSanctnNo><accnutYear>2019</accnutYear><chitNo>5090000003</chitNo><chitCreatAt>Y</chitCreatAt><chitCreatResultCn>5090000003 전표가 LENC 회사 코드에 전기되었습니다.</chitCreatResultCn></tprtvrtlchtVO></tprtvrtlchtList></Sap>'; file_download(xml, "aa.xml"); };