From 12c85c60c72256f45820553f61711d2948646415 Mon Sep 17 00:00:00 2001 From: kl Date: Thu, 31 Dec 2020 13:28:25 +0800 Subject: [PATCH] =?UTF-8?q?XML=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=88=87=E6=8D=A2=E7=BA=AF=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/main/resources/web/xml.ftl | 30 +++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/server/src/main/resources/web/xml.ftl b/server/src/main/resources/web/xml.ftl index cf804282..1b340969 100644 --- a/server/src/main/resources/web/xml.ftl +++ b/server/src/main/resources/web/xml.ftl @@ -13,10 +13,17 @@
-
+ + @@ -31,6 +38,7 @@ * 初始化 */ window.onload = function () { + $("#xml_btn").hide() initWaterMark(); loadXmlData() } @@ -40,11 +48,25 @@ */ function loadXmlData() { var textData = Base64.decode($("#textData").val()) + window.textPreData = "" + textData + ""; var xmlNode = xmlTreeViewer.parseXML(textData); - var retNode = xmlTreeViewer.getXMLViewerNode(xmlNode.xml); - $("#xml").html(retNode); + window.retNode = xmlTreeViewer.getXMLViewerNode(xmlNode.xml); + $("#xml").html(window.retNode); } + $(function () { + $("#xml_btn").click(function () { + $("#xml").html(window.retNode); + $("#text_btn").show() + $("#xml_btn").hide() + }); + + $("#text_btn").click(function () { + $("#xml_btn").show() + $("#text_btn").hide(); + $("#xml").html(window.textPreData); + }); + });