Whenever I run my code, I get the error {\"error\": \"Please use POST request\"} Does anyone know what this error means?
My code in jsfiddle: http://jsfiddle.ne
document.forms.form.submit();
This actually submits the <form>, you can't do that in jsFiddle1. Just remove that line, if you want to run the JavaScript, why are you submitting the form?
1: You can, but not using a <form>. You can test AJAX, see the docs. You're getting the error "Please use POST request" because by default <form> use GET. jsFiddle doesn't like being sent a query string, so it gave that error. You can POST stuff to it, but nothing will happen.