[annotator-dev] Custom Storage Plugin

Randall Leeds randall at bleeds.info
Fri Jul 31 16:54:17 UTC 2015


Can you check your browser dev tools to be sure your assessment is right.

I'm thinking that maybe the data is sent, but you're parsing it as form
encoded params rather than as JSON on your server?

Just a guess.

On Fri, Jul 31, 2015 at 8:37 AM Jamie McGowan <jamietyc at gmail.com> wrote:

> 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/d6249472/attachment-0004.html>


More information about the annotator-dev mailing list