From eb5e289a4ee76371c4593d0019a35e925ff13565 Mon Sep 17 00:00:00 2001 From: eastargh Date: Tue, 18 Aug 2026 13:52:10 +0900 Subject: [PATCH] =?UTF-8?q?=ED=97=A4=EB=8D=94=EB=B3=B5=EC=82=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tracking/trackingManDetail.jsp | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp b/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp index 5578624..18e3d05 100644 --- a/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp +++ b/WebContent/jsp/onl/transaction/tracking/trackingManDetail.jsp @@ -802,6 +802,35 @@ $(document).ready(function() { $("html, hbody").css("overflow-x","scroll"); } + function copyTextToClipboard(text, successMessage){ + if (typeof(navigator.clipboard) == 'undefined'){ + var textArea = document.createElement("textarea"); + textArea.value = text; + textArea.style.position = "fixed"; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + var successful = false; + try{ + successful = document.execCommand('copy'); + }catch(err){ + + } + document.body.removeChild(textArea); + if (successful){ + alert(successMessage); + }else{ + prompt("Ctrl+C 를 눌러 클립보드로 복사하세요.", text); + } + }else{ + navigator.clipboard.writeText(text).then(function(){ + alert(successMessage); + }).catch(function(){ + prompt("클립보드 복사에 실패했습니다. Ctrl+C 를 눌러 복사하세요.", text); + }); + } + } + $('#headerToClipboard').click(function(){ if($('#grid1').get(0) == null || $('#grid1').get(0).jexcel == null){ return; @@ -813,13 +842,11 @@ $(document).ready(function() { paddedValues += row[5].padEnd(row[4], " "); } - navigator.clipboard.writeText(paddedValues);//클립보드로 복사 - alert('헤더값이 복사되었습니다.') + copyTextToClipboard(paddedValues, '헤더값이 복사되었습니다.'); }); $('#messageToClipboard').click(function() { - navigator.clipboard.writeText(fullMessageData);//클립보드로 복사 - alert('전체 전문 복사되었습니다.') + copyTextToClipboard(fullMessageData, '전체 전문 복사되었습니다.'); }); $('#btn_pretty_print').click(function () {