<%-- Created by IntelliJ IDEA. User: admin Date: 2015/10/23 Time: 16:24 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <% String inData = request.getAttribute("inData").toString(); %> <%@ include file="/global/commonPage/includeHead/commonHead.jsp" %> <%@ include file="/global/commonPage/includeHead/extHead.jsp" %> <html> <head> <title>数据详情</title> <script src="<%=baseUrl%>/global/js/jquery.json.js" ></script> <script src="<%=baseUrl%>/global/js/jquery.zclip.js" ></script> <script> $(document).ready(function(){ var inData =‘<%=inData%>‘; formate2Json(inData); } ); function formate2Json(data){ var result = ‘‘; if(data != ‘‘){ try{ result = new JSONFormat(data, 4).toString(); } catch (e){ result = ‘<span style="color: #f1592a;font-weight:bold;">‘ + e + ‘</span>‘; } } // result = data; $("#main_data").html(result); } //关闭 function closeClick(){ $("#main_data").html(‘‘); parent.communicationEventHandlingWindow.hide(); } //复制 function selectAll(){ $("#choose_all").zclip({ path: "<%=baseUrl%>/global/js/ZeroClipboard.swf", copy: function(){ return $("#main_data").text(); }, beforeCopy:function(){/* 按住鼠标时的操作 */ $("#main_data").css("color","orange"); }, afterCopy:function(){/* 复制成功后的操作 */ var $copysuc = $("<div class=‘copy-tips‘><div class=‘copy-tips-wrap‘>? 复制成功</div></div>"); $("body").find(".copy-tips").remove().end().append($copysuc); $(".copy-tips").fadeOut(3000); } }); } //全选 function SelectAllClicked(){ //或者op1=$("#main_data")[0]; var oP1 = document.getElementById("main_data"); var v = document.createRange(); v.selectNode(oP1); window.getSelection().addRange(v); } </script> </head> <body style="overflow: scroll"> <div> <input type="button" value="全选" onclick="SelectAllClicked()"> <input type="button" value="复制" onclick="selectAll()" id="choose_all"> <input type="button" value="关闭" onclick="closeClick()"> </div> <hr/> <div id="main_data" style="font-weight:normal"></div> </body> </html>
时间: 2024-10-12 15:01:23