2017-04-07 7 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> 

エラー:私はコンソールログ「例外TypeError:_ref1が定義されていません」でこれを取得しています 私が間違っているの何すべてのアイデア、私はこれをショートカットするために助けてください。

答えて

0

私は

annotation.annotator( 'addPlugin'、 '店'、{ 接頭辞、この要求を使用して私の問題を解決:prefixUrl、 annotationData:{ 'URI': '/注釈' }、

ありがとうございました

関連する問題