2017-04-07 3 views
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이가 정의되어 있지 않습니다."

답변

0

내가이 요청,

annotation.annotator ('addPlugin', '스토어', { 접두사를 사용하여 내 문제를 해결 : prefixUrl을 annotationData : { 'URI': '/ 주석' }

감사합니다.

관련 문제