weixin_33736832 2018-02-09 10:59 采纳率: 0%
浏览 93

Ajax在Firefox中不起作用

this code doesn't work in firefox, in chrome it works and I'm getting results

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

output in chrome Chrome and this is output in firefox Firefox Who knows why $.Ajax doesn't work?

It something weird happening in our forest... :(

</div>
  • 写回答

1条回答 默认 最新

  • 谁还没个明天 2018-02-09 11:27
    关注

    Try this: `

    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);
      });
    

    `

    评论

报告相同问题?

悬赏问题

  • ¥15 大家帮我看看为什么错了
  • ¥15 unity互动琴弦抖动效果
  • ¥15 做了个的二极管反向饱和电流测量电路,但是测试达不到效果
  • ¥15 nginx无证书访问https失败
  • ¥15 树莓派启动AP热点传入数据
  • ¥15 multisim中关于74ls192n和DSWPK开关的问题(相关搜索:计数器)
  • ¥15 在误装Windows server2019 后如何利用Windows.old恢复?
  • ¥20 代码实现状态连接包过滤防火墙的设计与实现
  • ¥15 vscode的红色箭头爆红和has no default export报错
  • ¥15 关于#sql#的问题:#情况描述 在用vs对项目进行调试时,出现找不到网络路径,然后查看SQL配置工具,发现SQL服务显示远程调用过程失败(相关搜索:防火墙)