I want to be able to submit the form to two servers here (if there is a better way of doing this, I I am all ears)
I have an embedded embedded on mechanical turkey iframe is a form.
When a worker submits the form, I need to do two things:
I need to inform my local server so that I can do some work right now . I need to post the results, so that the next work can be displayed by Turkey.
If I do not do this, then my server will have to make a choice for the Turk to make the job, which is incompatible.
I have tried many plans but could not take them to work.
I have tried to use AJAX for posting locally, and submit a form, using the code looks like this:
<% = Form_for (@task ,: url = & gt; "http://workersandbox.mturk.com/mturk/externalSubmit",: remote = & gt; correct ;: method = & gt; "post" ,: Authenticity_token = & gt; wrong). F | & Gt%; .... and in my unchanged JS file
$ (form). Post ({url: "/ notify", opt, function () {Console.log ("notified")}); This is the result of a JS error
XMLHttpRequest can not load http://workersandbox.mturk.com/mturk/externalSubmit Genesis http: / /mytest.herokuapp.com is not allowed by access-control-permission-origin I have no control over the server, so I can not fix this problem.
Any suggestions regarding the correct method of doing so will be appreciated.
It's easy to do with jQuery. Basically if you use the .serialize () method, you can post the data to as many places as you want. Say you have one such form:
No comments:
Post a Comment