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 <jamie...@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
>
_______________________________________________
annotator-dev mailing list
annotator-dev@lists.okfn.org
https://lists.okfn.org/mailman/listinfo/annotator-dev
Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev

Reply via email to