私はprototype.jsでhttpbinリクエストに送信しようとしています
私のコード:
function loadTest()
{
new Ajax.Request('http://httpbin.org/get', { method:'get',
// success request
onSuccess:
function(transport) {
alert("Success! \n\n" + transport.status);
},
// fail request
onFailure:
function() {
alert('Something went wrong...');
}
});
}
実行後、私は得ました:Success!
そしてtransport.status = 0
なんで?リクエストを正しく送信し、prototype.js でレスポンスを取得するにはどうすればよいですか?
ありがとうございました。