ShoplinkerGoodsSendPreviewForm.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html lang="ko"
  3. xmlns="http://www.w3.org/1999/xhtml"
  4. xmlns:th="http://www.thymeleaf.org">
  5. <!--
  6. *******************************************************************************
  7. * @source : ShoplinkerGoodsSendPreviewForm.html
  8. * @desc : 샵링커 상품전송관리 미리보기 화면
  9. *============================================================================
  10. * STYLE24
  11. * Copyright(C) 2020 TSIT, All rights reserved.
  12. *============================================================================
  13. * VER DATE AUTHOR DESCRIPTION
  14. * === =========== ========== =============================================
  15. * 1.0 2021. 12. 20 jmh 최초 작성
  16. *******************************************************************************
  17. -->
  18. <head>
  19. <title>::샵링커 상품상세 미리보기::</title>
  20. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  21. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  22. </head>
  23. <body>
  24. <!-- 엑셀다운버튼 -->
  25. <div style="text-align: right; margin: 20px;">
  26. <button type="button" class="" onclick="fnDownloadHtml();">html 파일다운</button>
  27. </div>
  28. <!-- 컨텐츠 -->
  29. <th:block th:utext="${goodsInfo.xmlTxt}"></th:block>
  30. <!-- html 파일생성 -->
  31. <script th:inline="javascript">
  32. /*<![CDATA[*/
  33. function fnDownloadHtml() {
  34. var filename = [[${goodsInfo.goodsCd}]]+".html";
  35. var text = "<!DOCTYPE html><html><body>"+ [[${goodsInfo.xmlTxt}]] + "</body></html>";
  36. var pom = document.createElement('a');
  37. pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
  38. pom.setAttribute('download', filename);
  39. if (document.createEvent) {
  40. var event = document.createEvent('MouseEvents');
  41. event.initEvent('click', true, true);
  42. pom.dispatchEvent(event);
  43. }
  44. else {
  45. pom.click();
  46. }
  47. }
  48. /*]]>*/
  49. </script>
  50. </body>
  51. </html>