I’m testing out an Ajax form, and I’m getting behavior I wasn’t expecting. The request returns http 200 OK, but the xhr status is 0, error. I’m testing this against requestb.in.
Here’s my function (in coffeescript):
$.ajax
type: 'POST'
url: 'http://requestb.in/1fcyas71'
dataType: 'json'
data: { foo: "bar" }
error: (xhr, status, error) ->
$('div#response').text(error).addClass('error')
console.log status
console.log xhr
success: (data, status, xhr) ->
$('div#response').text(data).removeClass('error')
console.log status
console.log xhr
My understanding is requestb.in accepts any request, so why is this returning as an error?
You can’t do cross domain requests. Probably that’s the issue since dont think that You are employee of http://requestb.in ?