[annotator-dev] Custom Storage Plugin
Jamie McGowan
jamietyc at gmail.com
Fri Jul 31 15:37:45 UTC 2015
The POST successfully reaches the server. The problem is that when I go to
POST the annotation object, it seems to be empty (apart from the URL with I
add myself). Here is a snippet of the Javascript code:
........
this.annotator.subscribe("beforeAnnotationCreated", function(annotation) {
annotation.url = document.location.href;
})
.subscribe("annotationCreated", function(annotation) {
console.log("Created: %o", annotation);
jQuery.post("./annotator/create.php", annotation, function(data) {
console.log(data);
});
})
The console.log successfully prints the annotation object with is valid.
But an empty annotation object is being sent to the server (checked server
side).
I get this error: Uncaught Error: Error while finding start node:
undefined: TypeError: Cannot read property 'substring' of undefined
If I comment out the jQuery post, the error disappears. Is there something
wrong with the Javascript or am I supposed add this functionality outside
of pluginInit and where?
Thanks,
Jamie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150731/c748cca1/attachment-0004.html>
More information about the annotator-dev
mailing list