2017-03-28 81 views
0

以下異常的原因是什麼?未能在'SVGTextContentElement'上執行'getStartPositionOfChar'

DOMException: Failed to execute 'getStartPositionOfChar' on 'SVGTextContentElement': The charnum provided (0) is greater than or equal to the maximum bound (0). 

實際上,我試圖將https://github.com/nlplab/brat與我自己創建的後端集成在一起。它使用svg與jquery.svg.min.js和jquery.svgdom.min.js。但我被困在這個例外。該exeption的同時使呼叫作爲

text.getStartPositionOfChar(firstChar).x; 

,其中文本是

<text x="0" y="0">Some Text</text> 

firstChar=0 SVG的文本元素上引發。

回答

0

我相信這個錯誤在主分支中被修復,但在打包的版本1.3上沒有被修復。嘗試用GitHub(git clone https://github.com/nlplab/brat.git)直接克隆的小孩替換你的小孩。

相關問題