我有没有工作一个令人难以置信的简单的Ajax后:简单的Ajax后不工作
<html>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
var deviceDetails = [];
deviceDetails.project_title = 'project';
//deviceDetails.platform = window.device.platform;
deviceDetails.platform = 'ios';
$.ajax({
url: "http://someserver.com/device_api",
type: "post",
data: deviceDetails,
success: function(){
alert("success");
},
error: function(model, xhr, options){
alert('failed');
console.log('response is : ');
console.log(xhr.responseText);
},
});
</script>
</body>
</html>
服务器只是做到这一点:
我可以在Chrome中的网络选项卡上看到邮政的地位被“取消”。我错过了什么?
您是否收到任何错误? –
是否发送选项请求? – Quentin
我[试过你的代码](http://jsfiddle.net/75vYt/),可以看到POST请求**被**发送。 – Quentin