以下异常的原因是什么?
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。但我被这个例外困住了。在进行调用时,在 svg 的文本元素上引发了异常
text.getStartPositionOfChar(firstChar).x;
文本在哪里
<text x="0" y="0">Some Text</text>
和firstChar=0
。