我尝试发送到 httpbin使用 prototype.js 请求
我的代码:
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 正确发送请求并获得响应?
谢谢。
最佳答案
关于javascript - 发送 ajax 请求并使用 prototype.js 得到响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14123630/