1

我正在尝试添加一个自定义 JS 来切换堆栈跟踪信息。但是块没有变得可见。[![在此处输入图像描述][1]][1]

尝试将块传递给步骤详细信息<td>

 private String genStackTraceLink(String stackTrace){
        String stackTraceLnk = "";
        int iRandTraceCntr = 0;
        if (!stackTrace.isEmpty()) {
            iRandTraceCntr = new Random().nextInt(10000);
            stackTraceLnk = "<br><a href=\"#div" + iRandTraceCntr + "\" onclick=\"var el=getElementById('div"
                    + iRandTraceCntr + "');"
                    + "(el.style.display=='none')? (el.style.display='block') : (el.style.display='none'); "
                    + "(this.text == '+ Show stack trace')? "
                    + "(this.text='- Hide stack trace') : (this.text='+ Show stack trace'); this.style.fontSize='small'\"><font size='1'>+ Show stack trace</font></a>"
                    + "<div id=\"div" + iRandTraceCntr + "\" style=\"display:none\"><pre>" + stackTrace
                    + "</pre></div>";
            return stackTraceLnk;
        }
        return Globals.GC_EMPTY;
    }
4

0 回答 0