0
我正在使用annotator.js並在myqsl中存儲範圍。對於突出顯示文本,我在代碼文件上使用了這段代碼。使用annotator.js的註釋無法正常工作
<script src="/js/pdfjs/annotator.js"></script>
<script>
$(function(){
var annotation = $('#content').annotator();
annotation.annotator('addPlugin', 'Store', {
prefix: '',
urls: {
create: '/highlighter',
update: '/update/:id',
destroy: '/delete/:id',
search: '/highlightersearch'
}
});
var comments = {
"total": 1,
"rows": [
{
"text": "n thi",
"consumer": "d4c108122b51434aab1d27ad4ebd2b02",
"permissions": {
"update": [],
"read": [],
"admin": [],
"delete": []
},
"updated": "2017-04-07T10:31:55.378772+00:00",
"quote": "ffff",
"uri": "http://localhost:8124/user/pdf/14396734926770",
"id": "AVtH-G9LqWiVDsXRg1jq",
"ranges": [
{
"endOffset": 6,
"startOffset": 1,
"end": "/div[1]/div[1]/div[2]/div[4]",
"start": "/div[1]/div[1]/div[2]/div[4]"
}
],
"created": "2017-04-07T10:31:55.378759+00:00"
}]};
var arr = $.map(comments, function(el) { return el });
annotation.annotator("loadAnnotations", arr);
});
</script>
錯誤: 我在控制檯日誌得到這個「類型錯誤:_ref1未定義」 任何想法,我做錯了,請幫我這個快捷方式。