gpt4 book ai didi

javascript - Ajax 在 Firefox 中不起作用

转载 作者:行者123 更新时间:2023-11-30 20:45:58 26 4
gpt4 key购买 nike

此代码在 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 中输出 Chrome这是在 firefox 中的输出 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com