此代码在 firefox 中不起作用,在 chrome 中它起作用并且我得到了结果
console.log('send');
$.ajax({
url: my_object.ajax_url,
type: 'POST',
data: {
action: 'sendPhone',
phone: '23342342',
city: 'sddsfsf',
},
beforeSend: function(){
console.log('beforeSend');
},
success: function(msg){
console.log('result = '+msg);
return;
},
});//end $.ajax
在 chrome 中输出 这是在 firefox 中的输出 谁知道为什么 $.Ajax 不起作用?
我们的森林里发生了一些奇怪的事情...... :(
最佳答案
试试这个: `
console.log('send');
$.ajax({
url: my_object.ajax_url,
type: 'POST',
data: {
action: 'sendPhone',
phone: '23342342',
city: 'sddsfsf',
},
beforeSend: function(){
console.log('beforeSend');
}
})
.success(function(msg){
console.log('result = ' + msg);
});
`
关于javascript - Ajax 在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48704358/