ajax在firebase生产环境中不起作用,但在localhost ajax代码上工作
var settings = {
"async": true,
"crossDomain": true,
"url": "https://some_other_domain:3000/",
"method": "POST",
"dataType": "json",
"headers": {
"Access-Control-Allow-Origin" : "*",
"Access-Control-Allow-Headers" : "Origin, X-Requested-With, Content-Type, Accept",
"Access-Control-Allow-Methods" : "GET,PUT,POST,DELETE",
"Content-Type": "application/json",
"Cache-Control": "no-cache",
},
"processData": false,
"crossDomain":true,
"timeout": 3000,
"data": JSON.stringify(emailData)
}
$.ajax(settings)
.done(function (response) {
on firebase-托管我的请求超时(如检查器中的网络选项卡上所示,并且控制台不显示任何错误)。在localhost它工作正常。我试过Mozila Firefox和Google Chrome。