javascript - Annotations using annotator.js is not working properly -
i using annotator.js , store range in myqsl. highlight text using code on code file.
<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>
error: getting on console log "typeerror: _ref1 undefined" idea doing wrong, please me shortcut this.
i solved problem using request,
annotation.annotator('addplugin', 'store', { prefix: prefixurl, annotationdata: { 'uri': '/annotations' },
thanks
Comments
Post a Comment