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

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

    `

    评论

报告相同问题?